diff --git a/EI_TestProject/APITest_User_UserType_Menu.cs b/EI_TestProject/APITest_User_UserType_Menu.cs index df35b956..127b89b4 100644 --- a/EI_TestProject/APITest_User_UserType_Menu.cs +++ b/EI_TestProject/APITest_User_UserType_Menu.cs @@ -6,6 +6,7 @@ using BeetleX.Redis.Commands; using EI_TestProject; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; using Newtonsoft.Json; @@ -31,6 +32,7 @@ public class UserApiTests : IDisposable } + /// /// 添加系统用户 /// @@ -67,6 +69,45 @@ public class UserApiTests : IDisposable Assert.True(result.Code != ApiResponseCodeEnum.ApiInputError && result.Code != ApiResponseCodeEnum.ProgramException); } + /// + /// 更新用户 + /// + public async void Test_UpdateUser() + { + var url = $"/user/updateUser"; + + var jsonBody = new JObject + { + { "CanEditUserType", false }, + { "Id", "d83f0000-3e2c-0016-2ed8-08db3f051caf" }, + { "UserName", "zhouhang" }, + { "Password", "e10adc3949ba59abbe56e057f20f883e" }, + { "RealName", "zhou / hang" }, + { "FirstName", "hang" }, + { "LastName", "zhou" }, + { "Sex", 1 }, + { "Status", 1 }, + { "Phone", "17673237815" }, + { "EMail", "872297557@qq.com" }, + { "UserTypeId", "40240000-3e2c-0016-b35f-08db1895d627" }, + { "UserCode", "U0178" }, + { "UserType", "PM (Project Manager)" }, + { "UserTypeShortName", "PM" }, + { "UserTypeEnum", 1 }, + { "IsZhiZhun", true }, + { "OrganizationName", "ExtImaging" }, + { "DepartmentName", "xx" }, + { "PositionName", "xx" }, + { "IsTestUser", false }, + { "BaseUrl", "http://123.56.94.154:8090/login" }, + { "RouteUrl", "http://123.56.94.154:8090/email-recompose" } + }; + + var result = await RestHelper.Post_JsonBodyRequestAsync>(url, jsonBody); + + + Assert.True(result.Code != ApiResponseCodeEnum.ApiInputError && result.Code != ApiResponseCodeEnum.ProgramException); + } /// /// 查询系统用户 @@ -105,6 +146,9 @@ public class UserApiTests : IDisposable } + /// + /// 角色 + /// [Fact] public async void Test_GetUserTypeRoleList() { @@ -120,13 +164,120 @@ public class UserApiTests : IDisposable } + /// + /// 匿名化配置 + /// [Fact] - public async void Test_AddUserTypeRole() + public async void Test_getSystemAnonymizationList() + { + var url = $"/SystemAnonymization/getSystemAnonymizationList"; + + var jsonBody = new JObject + { + { "Group", "" }, + { "Element", "" }, + { "TagDescription", "" }, + { "IsAdd", false }, + { "TagDescriptionCN", "" }, + { "PageIndex", 1 }, + { "PageSize", 500 } + }; + + + var result = await RestHelper.Post_JsonBodyRequestAsync>>(url, jsonBody); + + Assert.True(result.Data.CurrentPageData.Count >= 0); + } + + + + /// + /// 删除匿名化配置 + /// + [Fact] + public async void Test_DeleteSystemAnonymization() + { + var id = Guid.Parse("98430000-3e2c-0016-225f-08db7612c7ae"); + var url = $"/SystemAnonymization/deleteSystemAnonymization/{id}"; + + //测试删除Api + var result = await RestHelper.DeleteRequestAsync>(url); + + Assert.True(result.Code != ApiResponseCodeEnum.ApiInputError && result.Code != ApiResponseCodeEnum.ProgramException); + } + + + /// + /// 更新 匿名化配置 + /// + [Fact] + public async void Test_UpdateSystemAnonymization() { + var url = $"/SystemAnonymization/addOrUpdateSystemAnonymization"; + + var jsonBody = new JObject + { + { "CreateUserId", "e2e165a0-44b0-4b16-9a4d-0b9b7a1ce362" }, + { "UpdateTime", "2023-06-19 14:36:56" }, + { "UpdateUserId", "e2e165a0-44b0-4b16-9a4d-0b9b7a1ce362" }, + { "CreateTime", "2023-06-15 10:21:19" }, + { "Id", "640a0000-3e2c-0016-ae9b-08db6d4734c9" }, + { "Group", "1" }, + { "Element", "2" }, + { "TagDescription", "3" }, + { "TagDescriptionCN", "4" }, + { "ReplaceValue", "123" }, + { "ValueRepresentation", "5" }, + { "IsAdd", false }, + { "IsEnable", true }, + { "IsFixed", true } + }; + + + var result = await RestHelper.Post_JsonBodyRequestAsync>(url, jsonBody); + + + Assert.True(result.Code != ApiResponseCodeEnum.ApiInputError && result.Code != ApiResponseCodeEnum.ProgramException); } + /// + /// 更新 匿名化配置 + /// + [Fact] + public async void Test_AddSystemAnonymization() + { + + var url = $"/SystemAnonymization/addOrUpdateSystemAnonymization"; + + + var jsonBody = new JObject + { + { "Group", "0010" }, + { "Element", "0021" }, + { "TagDescription", "test" }, + { "TagDescriptionCN", "test" }, + { "ValueRepresentation", "test" }, + { "ReplaceValue", "test" }, + { "IsEnable", false }, + { "IsAdd", false }, + { "IsFixed", false } + }; + + + var result = await RestHelper.Post_JsonBodyRequestAsync>(url, jsonBody); + + + Assert.True(result.Code != ApiResponseCodeEnum.ApiInputError && result.Code != ApiResponseCodeEnum.ProgramException); + } + + + + + + + public void Dispose() { // 在测试结束后释放资源(例如关闭网络连接等)