mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
sync with OpenAuth.Core
This commit is contained in:
@@ -17,7 +17,7 @@ namespace OpenAuth.App.Test
|
||||
var services = new ServiceCollection();
|
||||
|
||||
var cachemock = new Mock<ICacheContext>();
|
||||
cachemock.Setup(x => x.Get<UserAuthSession>("tokentest")).Returns(new UserAuthSession { Account = "System" });
|
||||
cachemock.Setup(x => x.Get<UserAuthSession>("tokentest")).Returns(new UserAuthSession { Account = Define.SYSTEM_USERNAME});
|
||||
services.AddScoped(x => cachemock.Object);
|
||||
|
||||
var httpContextAccessorMock = new Mock<IHttpContextAccessor>();
|
||||
@@ -28,6 +28,27 @@ namespace OpenAuth.App.Test
|
||||
return services;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试添加用户时,数据校验。
|
||||
/// 因为请求数据没有Account,Name等,该测试会提示异常
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestValidation()
|
||||
{
|
||||
var app = _autofacServiceProvider.GetService<UserManagerApp>();
|
||||
try
|
||||
{
|
||||
app.AddOrUpdate(new UpdateUserReq
|
||||
{
|
||||
OrganizationIds = "08f41bf6-4388-4b1e-bd3e-2ff538b44b1b",
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAdd()
|
||||
{
|
||||
|
Reference in New Issue
Block a user