Skip to content

Commit

Permalink
Merge pull request #46 from Soar360/fix_unit_test
Browse files Browse the repository at this point in the history
Fix unit test
  • Loading branch information
Soar360 authored Sep 22, 2024
2 parents 15a4ac9 + 2c609cc commit 8613c2b
Show file tree
Hide file tree
Showing 30 changed files with 457 additions and 309 deletions.
2 changes: 1 addition & 1 deletion XCode/DataAccessLayer/MetaData/DbMetaData_Positive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ protected virtual List<KeyValuePair<Type, Type>> FieldTypeMaps
if (type == null) return null;

//处理数组
if (type.IsArray) type = type.GetElementType();
if (field.IsArray && type.IsArray) type = type.GetElementType();

// 处理枚举
if (type.IsEnum) type = typeof(Int32);
Expand Down
10 changes: 10 additions & 0 deletions XUnitTest.XCode/Code/BuildTT/UserTT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,21 @@ public partial class UserTT
[DisplayName("邮件")]
public String Mail { get; set; }

/// <summary>邮箱是否验证。</summary>
[Description("邮箱是否验证。")]
[DisplayName("邮箱是否验证")]
public Boolean MailVerified { get; set; }

/// <summary>手机。支持登录</summary>
[Description("手机。支持登录")]
[DisplayName("手机")]
public String Mobile { get; set; }

/// <summary>手机是否验证。</summary>
[Description("手机是否验证。")]
[DisplayName("手机是否验证")]
public Boolean MobileVerified { get; set; }

/// <summary>代码。身份证、员工编码等,支持登录</summary>
[Description("代码。身份证、员工编码等,支持登录")]
[DisplayName("代码")]
Expand Down
6 changes: 6 additions & 0 deletions XUnitTest.XCode/Code/Dtos/IUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ public partial interface IUser
/// <summary>邮件。支持登录</summary>
String? Mail { get; set; }

/// <summary>邮箱是否验证。</summary>
Boolean MailVerified { get; set; }

/// <summary>手机。支持登录</summary>
String? Mobile { get; set; }

/// <summary>手机是否验证。</summary>
Boolean MobileVerified { get; set; }

/// <summary>代码。身份证、员工编码等,支持登录</summary>
String? Code { get; set; }

Expand Down
6 changes: 6 additions & 0 deletions XUnitTest.XCode/Code/Dtos/UserDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ public partial class UserDto
/// <summary>邮件。支持登录</summary>
public String? Mail { get; set; }

/// <summary>邮箱是否验证。</summary>
public Boolean MailVerified { get; set; }

/// <summary>手机。支持登录</summary>
public String? Mobile { get; set; }

/// <summary>手机是否验证。</summary>
public Boolean MobileVerified { get; set; }

/// <summary>代码。身份证、员工编码等,支持登录</summary>
public String? Code { get; set; }

Expand Down
36 changes: 18 additions & 18 deletions XUnitTest.XCode/Code/Entity/地区.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,24 +233,24 @@ public override Object? this[String name]
{
switch (name)
{
case "ID": _ID = value.ToInt(); break;
case "Name": _Name = Convert.ToString(value); break;
case "FullName": _FullName = Convert.ToString(value); break;
case "ParentID": _ParentID = value.ToInt(); break;
case "Level": _Level = value.ToInt(); break;
case "Kind": _Kind = Convert.ToString(value); break;
case "English": _English = Convert.ToString(value); break;
case "PinYin": _PinYin = Convert.ToString(value); break;
case "JianPin": _JianPin = Convert.ToString(value); break;
case "TelCode": _TelCode = Convert.ToString(value); break;
case "ZipCode": _ZipCode = Convert.ToString(value); break;
case "Longitude": _Longitude = value.ToDouble(); break;
case "Latitude": _Latitude = value.ToDouble(); break;
case "GeoHash": _GeoHash = Convert.ToString(value); break;
case "Enable": _Enable = value.ToBoolean(); break;
case "CreateTime": _CreateTime = value.ToDateTime(); break;
case "UpdateTime": _UpdateTime = value.ToDateTime(); break;
case "Remark": _Remark = Convert.ToString(value); break;
case "ID": _ID = ValidHelper.ToInt32(value); break;
case "Name": _Name = ValidHelper.ToString(value); break;
case "FullName": _FullName = ValidHelper.ToString(value); break;
case "ParentID": _ParentID = ValidHelper.ToInt32(value); break;
case "Level": _Level = ValidHelper.ToInt32(value); break;
case "Kind": _Kind = ValidHelper.ToString(value); break;
case "English": _English = ValidHelper.ToString(value); break;
case "PinYin": _PinYin = ValidHelper.ToString(value); break;
case "JianPin": _JianPin = ValidHelper.ToString(value); break;
case "TelCode": _TelCode = ValidHelper.ToString(value); break;
case "ZipCode": _ZipCode = ValidHelper.ToString(value); break;
case "Longitude": _Longitude = ValidHelper.ToDouble(value); break;
case "Latitude": _Latitude = ValidHelper.ToDouble(value); break;
case "GeoHash": _GeoHash = ValidHelper.ToString(value); break;
case "Enable": _Enable = ValidHelper.ToBoolean(value); break;
case "CreateTime": _CreateTime = ValidHelper.ToDateTime(value); break;
case "UpdateTime": _UpdateTime = ValidHelper.ToDateTime(value); break;
case "Remark": _Remark = ValidHelper.ToString(value); break;
default: base[name] = value; break;
}
}
Expand Down
46 changes: 23 additions & 23 deletions XUnitTest.XCode/Code/Entity/字典参数.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,29 +292,29 @@ public override Object? this[String name]
{
switch (name)
{
case "ID": _ID = value.ToInt(); break;
case "UserID": _UserID = value.ToInt(); break;
case "Category": _Category = Convert.ToString(value); break;
case "Name": _Name = Convert.ToString(value); break;
case "Value": _Value = Convert.ToString(value); break;
case "LongValue": _LongValue = Convert.ToString(value); break;
case "Kind": _Kind = (XCode.Membership.ParameterKinds)value.ToInt(); break;
case "Enable": _Enable = value.ToBoolean(); break;
case "Ex1": _Ex1 = value.ToInt(); break;
case "Ex2": _Ex2 = Convert.ToDecimal(value); break;
case "Ex3": _Ex3 = value.ToDouble(); break;
case "Ex4": _Ex4 = Convert.ToString(value); break;
case "Ex5": _Ex5 = Convert.ToString(value); break;
case "Ex6": _Ex6 = Convert.ToString(value); break;
case "CreateUser": _CreateUser = Convert.ToString(value); break;
case "CreateUserID": _CreateUserID = value.ToInt(); break;
case "CreateIP": _CreateIP = Convert.ToString(value); break;
case "CreateTime": _CreateTime = value.ToDateTime(); break;
case "UpdateUser": _UpdateUser = Convert.ToString(value); break;
case "UpdateUserID": _UpdateUserID = value.ToInt(); break;
case "UpdateIP": _UpdateIP = Convert.ToString(value); break;
case "UpdateTime": _UpdateTime = value.ToDateTime(); break;
case "Remark": _Remark = Convert.ToString(value); break;
case "ID": _ID = ValidHelper.ToInt32(value); break;
case "UserID": _UserID = ValidHelper.ToInt32(value); break;
case "Category": _Category = ValidHelper.ToString(value); break;
case "Name": _Name = ValidHelper.ToString(value); break;
case "Value": _Value = ValidHelper.ToString(value); break;
case "LongValue": _LongValue = ValidHelper.ToString(value); break;
case "Kind": _Kind = ValidHelper.ToEnum<XCode.Membership.ParameterKinds>(value); break;
case "Enable": _Enable = ValidHelper.ToBoolean(value); break;
case "Ex1": _Ex1 = ValidHelper.ToInt32(value); break;
case "Ex2": _Ex2 = ValidHelper.ToDecimal(value); break;
case "Ex3": _Ex3 = ValidHelper.ToDouble(value); break;
case "Ex4": _Ex4 = ValidHelper.ToString(value); break;
case "Ex5": _Ex5 = ValidHelper.ToString(value); break;
case "Ex6": _Ex6 = ValidHelper.ToString(value); break;
case "CreateUser": _CreateUser = ValidHelper.ToString(value); break;
case "CreateUserID": _CreateUserID = ValidHelper.ToInt32(value); break;
case "CreateIP": _CreateIP = ValidHelper.ToString(value); break;
case "CreateTime": _CreateTime = ValidHelper.ToDateTime(value); break;
case "UpdateUser": _UpdateUser = ValidHelper.ToString(value); break;
case "UpdateUserID": _UpdateUserID = ValidHelper.ToInt32(value); break;
case "UpdateIP": _UpdateIP = ValidHelper.ToString(value); break;
case "UpdateTime": _UpdateTime = ValidHelper.ToDateTime(value); break;
case "Remark": _Remark = ValidHelper.ToString(value); break;
default: base[name] = value; break;
}
}
Expand Down
38 changes: 19 additions & 19 deletions XUnitTest.XCode/Code/Entity/成员日志.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,25 +246,25 @@ public override Object? this[String name]
{
switch (name)
{
case "ID": _ID = value.ToLong(); break;
case "Ds": _Ds = Convert.ToString(value); break;
case "Category": _Category = Convert.ToString(value); break;
case "Action": _Action = Convert.ToString(value); break;
case "LinkID": _LinkID = value.ToInt(); break;
case "Success": _Success = value.ToBoolean(); break;
case "UserName": _UserName = Convert.ToString(value); break;
case "Ex1": _Ex1 = value.ToInt(); break;
case "Ex2": _Ex2 = value.ToInt(); break;
case "Ex3": _Ex3 = value.ToDouble(); break;
case "Ex4": _Ex4 = Convert.ToString(value); break;
case "Ex5": _Ex5 = Convert.ToString(value); break;
case "Ex6": _Ex6 = Convert.ToString(value); break;
case "TraceId": _TraceId = Convert.ToString(value); break;
case "CreateUser": _CreateUser = Convert.ToString(value); break;
case "CreateUserID": _CreateUserID = value.ToInt(); break;
case "CreateIP": _CreateIP = Convert.ToString(value); break;
case "CreateTime": _CreateTime = value.ToDateTime(); break;
case "Remark": _Remark = Convert.ToString(value); break;
case "ID": _ID = ValidHelper.ToInt64(value); break;
case "Ds": _Ds = ValidHelper.ToString(value); break;
case "Category": _Category = ValidHelper.ToString(value); break;
case "Action": _Action = ValidHelper.ToString(value); break;
case "LinkID": _LinkID = ValidHelper.ToInt32(value); break;
case "Success": _Success = ValidHelper.ToBoolean(value); break;
case "UserName": _UserName = ValidHelper.ToString(value); break;
case "Ex1": _Ex1 = ValidHelper.ToInt32(value); break;
case "Ex2": _Ex2 = ValidHelper.ToInt32(value); break;
case "Ex3": _Ex3 = ValidHelper.ToDouble(value); break;
case "Ex4": _Ex4 = ValidHelper.ToString(value); break;
case "Ex5": _Ex5 = ValidHelper.ToString(value); break;
case "Ex6": _Ex6 = ValidHelper.ToString(value); break;
case "TraceId": _TraceId = ValidHelper.ToString(value); break;
case "CreateUser": _CreateUser = ValidHelper.ToString(value); break;
case "CreateUserID": _CreateUserID = ValidHelper.ToInt32(value); break;
case "CreateIP": _CreateIP = ValidHelper.ToString(value); break;
case "CreateTime": _CreateTime = ValidHelper.ToDateTime(value); break;
case "Remark": _Remark = ValidHelper.ToString(value); break;
default: base[name] = value; break;
}
}
Expand Down
36 changes: 18 additions & 18 deletions XUnitTest.XCode/Code/Entity/日志.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,24 +238,24 @@ public override Object? this[String name]
{
switch (name)
{
case "ID": _ID = value.ToLong(); break;
case "Category": _Category = Convert.ToString(value); break;
case "Action": _Action = Convert.ToString(value); break;
case "LinkID": _LinkID = value.ToInt(); break;
case "Success": _Success = value.ToBoolean(); break;
case "UserName": _UserName = Convert.ToString(value); break;
case "Ex1": _Ex1 = value.ToInt(); break;
case "Ex2": _Ex2 = value.ToInt(); break;
case "Ex3": _Ex3 = value.ToDouble(); break;
case "Ex4": _Ex4 = Convert.ToString(value); break;
case "Ex5": _Ex5 = Convert.ToString(value); break;
case "Ex6": _Ex6 = Convert.ToString(value); break;
case "TraceId": _TraceId = Convert.ToString(value); break;
case "CreateUser": _CreateUser = Convert.ToString(value); break;
case "CreateUserID": _CreateUserID = value.ToInt(); break;
case "CreateIP": _CreateIP = Convert.ToString(value); break;
case "CreateTime": _CreateTime = value.ToDateTime(); break;
case "Remark": _Remark = Convert.ToString(value); break;
case "ID": _ID = ValidHelper.ToInt64(value); break;
case "Category": _Category = ValidHelper.ToString(value); break;
case "Action": _Action = ValidHelper.ToString(value); break;
case "LinkID": _LinkID = ValidHelper.ToInt32(value); break;
case "Success": _Success = ValidHelper.ToBoolean(value); break;
case "UserName": _UserName = ValidHelper.ToString(value); break;
case "Ex1": _Ex1 = ValidHelper.ToInt32(value); break;
case "Ex2": _Ex2 = ValidHelper.ToInt32(value); break;
case "Ex3": _Ex3 = ValidHelper.ToDouble(value); break;
case "Ex4": _Ex4 = ValidHelper.ToString(value); break;
case "Ex5": _Ex5 = ValidHelper.ToString(value); break;
case "Ex6": _Ex6 = ValidHelper.ToString(value); break;
case "TraceId": _TraceId = ValidHelper.ToString(value); break;
case "CreateUser": _CreateUser = ValidHelper.ToString(value); break;
case "CreateUserID": _CreateUserID = ValidHelper.ToInt32(value); break;
case "CreateIP": _CreateIP = ValidHelper.ToString(value); break;
case "CreateTime": _CreateTime = ValidHelper.ToDateTime(value); break;
case "Remark": _Remark = ValidHelper.ToString(value); break;
default: base[name] = value; break;
}
}
Expand Down
68 changes: 34 additions & 34 deletions XUnitTest.XCode/Code/Entity/用户.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,40 +409,40 @@ public override Object? this[String name]
{
switch (name)
{
case "ID": _ID = value.ToInt(); break;
case "Name": _Name = Convert.ToString(value); break;
case "Password": _Password = Convert.ToString(value); break;
case "DisplayName": _DisplayName = Convert.ToString(value); break;
case "Sex": _Sex = (XCode.Membership.SexKinds)value.ToInt(); break;
case "Mail": _Mail = Convert.ToString(value); break;
case "Mobile": _Mobile = Convert.ToString(value); break;
case "Code": _Code = Convert.ToString(value); break;
case "AreaId": _AreaId = value.ToInt(); break;
case "Avatar": _Avatar = Convert.ToString(value); break;
case "RoleID": _RoleID = value.ToInt(); break;
case "RoleIds": _RoleIds = Convert.ToString(value); break;
case "DepartmentID": _DepartmentID = value.ToInt(); break;
case "Online": _Online = value.ToBoolean(); break;
case "Enable": _Enable = value.ToBoolean(); break;
case "Age": _Age = value.ToInt(); break;
case "Birthday": _Birthday = value.ToDateTime(); break;
case "Logins": _Logins = value.ToInt(); break;
case "LastLogin": _LastLogin = value.ToDateTime(); break;
case "LastLoginIP": _LastLoginIP = Convert.ToString(value); break;
case "RegisterTime": _RegisterTime = value.ToDateTime(); break;
case "RegisterIP": _RegisterIP = Convert.ToString(value); break;
case "OnlineTime": _OnlineTime = value.ToInt(); break;
case "Ex1": _Ex1 = value.ToInt(); break;
case "Ex2": _Ex2 = value.ToInt(); break;
case "Ex3": _Ex3 = value.ToDouble(); break;
case "Ex4": _Ex4 = Convert.ToString(value); break;
case "Ex5": _Ex5 = Convert.ToString(value); break;
case "Ex6": _Ex6 = Convert.ToString(value); break;
case "UpdateUser": _UpdateUser = Convert.ToString(value); break;
case "UpdateUserID": _UpdateUserID = value.ToInt(); break;
case "UpdateIP": _UpdateIP = Convert.ToString(value); break;
case "UpdateTime": _UpdateTime = value.ToDateTime(); break;
case "Remark": _Remark = Convert.ToString(value); break;
case "ID": _ID = ValidHelper.ToInt32(value); break;
case "Name": _Name = ValidHelper.ToString(value); break;
case "Password": _Password = ValidHelper.ToString(value); break;
case "DisplayName": _DisplayName = ValidHelper.ToString(value); break;
case "Sex": _Sex = ValidHelper.ToEnum<XCode.Membership.SexKinds>(value); break;
case "Mail": _Mail = ValidHelper.ToString(value); break;
case "Mobile": _Mobile = ValidHelper.ToString(value); break;
case "Code": _Code = ValidHelper.ToString(value); break;
case "AreaId": _AreaId = ValidHelper.ToInt32(value); break;
case "Avatar": _Avatar = ValidHelper.ToString(value); break;
case "RoleID": _RoleID = ValidHelper.ToInt32(value); break;
case "RoleIds": _RoleIds = ValidHelper.ToString(value); break;
case "DepartmentID": _DepartmentID = ValidHelper.ToInt32(value); break;
case "Online": _Online = ValidHelper.ToBoolean(value); break;
case "Enable": _Enable = ValidHelper.ToBoolean(value); break;
case "Age": _Age = ValidHelper.ToInt32(value); break;
case "Birthday": _Birthday = ValidHelper.ToDateTime(value); break;
case "Logins": _Logins = ValidHelper.ToInt32(value); break;
case "LastLogin": _LastLogin = ValidHelper.ToDateTime(value); break;
case "LastLoginIP": _LastLoginIP = ValidHelper.ToString(value); break;
case "RegisterTime": _RegisterTime = ValidHelper.ToDateTime(value); break;
case "RegisterIP": _RegisterIP = ValidHelper.ToString(value); break;
case "OnlineTime": _OnlineTime = ValidHelper.ToInt32(value); break;
case "Ex1": _Ex1 = ValidHelper.ToInt32(value); break;
case "Ex2": _Ex2 = ValidHelper.ToInt32(value); break;
case "Ex3": _Ex3 = ValidHelper.ToDouble(value); break;
case "Ex4": _Ex4 = ValidHelper.ToString(value); break;
case "Ex5": _Ex5 = ValidHelper.ToString(value); break;
case "Ex6": _Ex6 = ValidHelper.ToString(value); break;
case "UpdateUser": _UpdateUser = ValidHelper.ToString(value); break;
case "UpdateUserID": _UpdateUserID = ValidHelper.ToInt32(value); break;
case "UpdateIP": _UpdateIP = ValidHelper.ToString(value); break;
case "UpdateTime": _UpdateTime = ValidHelper.ToDateTime(value); break;
case "Remark": _Remark = ValidHelper.ToString(value); break;
default: base[name] = value; break;
}
}
Expand Down
Loading

0 comments on commit 8613c2b

Please sign in to comment.