|
|
@@ -12,6 +12,9 @@ public class SmartOpsTrustedScopeTests
|
|
|
private const long FactoryA = 838257186320453;
|
|
|
private const long FactoryB = 838257212858437;
|
|
|
|
|
|
+ /// <summary>种子/脚本建的租户(如 Ai-DOP 演示公司),根组织与租户同号。</summary>
|
|
|
+ private const long SeededTenant = 1300000000777;
|
|
|
+
|
|
|
[Fact]
|
|
|
public void PlatformTenant_IsRejected()
|
|
|
{
|
|
|
@@ -41,12 +44,22 @@ public class SmartOpsTrustedScopeTests
|
|
|
}
|
|
|
|
|
|
[Fact]
|
|
|
- public void MissingOrSelfFactory_IsRejected()
|
|
|
+ public void MissingOrg_IsRejected()
|
|
|
{
|
|
|
Assert.Throws<InvalidOperationException>(() =>
|
|
|
SmartOpsTrustedScopeRules.ResolveFactory(TenantA, 0, FactoryA));
|
|
|
- Assert.Throws<InvalidOperationException>(() =>
|
|
|
- SmartOpsTrustedScopeRules.ResolveFactory(TenantA, TenantA, FactoryA));
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 种子/SQL 脚本建的租户,其根组织 Id 与租户 Id 同号(Admin.NET 官方约定,
|
|
|
+ /// 见 SysTenantSeedData「Id=OrgId=DefaultTenantId」与 SysOrgSeedData 根组织)。
|
|
|
+ /// 该形态是「已配置组织」,不得当成「未配置」拒绝。
|
|
|
+ /// </summary>
|
|
|
+ [Fact]
|
|
|
+ public void SeededTenant_WhoseRootOrgSharesTenantId_IsAccepted()
|
|
|
+ {
|
|
|
+ Assert.Equal(SeededTenant, SmartOpsTrustedScopeRules.ResolveFactory(SeededTenant, SeededTenant, null));
|
|
|
+ Assert.Equal(SeededTenant, SmartOpsTrustedScopeRules.ResolveFactory(SeededTenant, SeededTenant, FactoryA));
|
|
|
}
|
|
|
|
|
|
[Fact]
|