-
-
Notifications
You must be signed in to change notification settings - Fork 253
/
MultiTenantContextShould.cs
40 lines (34 loc) · 1.14 KB
/
MultiTenantContextShould.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using Xunit;
namespace Finbuckle.MultiTenant.Test;
public class MultiTenantContextShould
{
[Fact]
public void ReturnFalseInHasResolvedTenantIfTenantInfoIsNull()
{
IMultiTenantContext<TenantInfo> context = new MultiTenantContext<TenantInfo>();
Assert.False(context.HasResolvedTenant);
}
[Fact]
public void ReturnTrueInHasResolvedTenantIfTenantInfoIsNotNull()
{
IMultiTenantContext<TenantInfo> context = new MultiTenantContext<TenantInfo>();
context.TenantInfo = new TenantInfo();
Assert.True(context.HasResolvedTenant);
}
[Fact]
public void ReturnFalseInHasResolvedTenantIfTenantInfoIsNull_NonGeneric()
{
IMultiTenantContext context = new MultiTenantContext<TenantInfo>();
Assert.False(context.HasResolvedTenant);
}
[Fact]
public void ReturnTrueInHasResolvedTenantIfTenantInfoIsNotNull_NonGeneric()
{
var context = new MultiTenantContext<TenantInfo>
{
TenantInfo = new TenantInfo()
};
IMultiTenantContext iContext = context;
Assert.True(iContext.HasResolvedTenant);
}
}