mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 01:58:01 +08:00
修复单元测试异常
This commit is contained in:
@@ -27,20 +27,24 @@ namespace OpenAuth.App
|
||||
}
|
||||
CaculateCascade(org);
|
||||
|
||||
Repository.Add(org);
|
||||
|
||||
//如果当前账号不是SYSTEM,则直接分配
|
||||
var loginUser = _auth.GetCurrentUser();
|
||||
if (loginUser.User.Account != Define.SYSTEM_USERNAME)
|
||||
UnitWork.ExecuteWithTransaction(() =>
|
||||
{
|
||||
_revelanceApp.Assign(new AssignReq
|
||||
UnitWork.Add(org);
|
||||
UnitWork.Save();
|
||||
|
||||
//如果当前账号不是SYSTEM,则直接分配
|
||||
var loginUser = _auth.GetCurrentUser();
|
||||
if (loginUser.User.Account != Define.SYSTEM_USERNAME)
|
||||
{
|
||||
type=Define.USERORG,
|
||||
firstId = loginContext.User.Id,
|
||||
secIds = new[]{org.Id}
|
||||
});
|
||||
}
|
||||
|
||||
_revelanceApp.Assign(new AssignReq
|
||||
{
|
||||
type = Define.USERORG,
|
||||
firstId = loginContext.User.Id,
|
||||
secIds = new[] { org.Id }
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return org.Id;
|
||||
}
|
||||
|
||||
|
@@ -21,6 +21,7 @@ namespace OpenAuth.App.Test
|
||||
var serviceCollection = GetService();
|
||||
serviceCollection.AddMemoryCache();
|
||||
serviceCollection.AddOptions();
|
||||
serviceCollection.AddLogging();
|
||||
|
||||
var optionMock = new Mock<IOptions<AppSetting>>();
|
||||
optionMock.Setup(x => x.Value).Returns(new AppSetting { DbType = Define.DBTYPE_MYSQL});
|
||||
|
Reference in New Issue
Block a user