-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add HasResolvedTenant to IMultiTenantContext (#650)
- Loading branch information
1 parent
265d26d
commit 375add5
Showing
10 changed files
with
99 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
test/Finbuckle.MultiTenant.Test/MultiTenantContextShould.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters