-
-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: throw exception when tenant id is missing for when using databa…
…se per tenant
- Loading branch information
1 parent
5c69422
commit c8f1941
Showing
1 changed file
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Marten; | ||
using Marten.Testing.Harness; | ||
using Shouldly; | ||
using Xunit.Abstractions; | ||
|
||
namespace MultiTenancyTests; | ||
|
||
public class using_database_per_tenant: IAsyncLifetime | ||
{ | ||
private readonly ITestOutputHelper _testOutputHelper; | ||
private DocumentStore _theStore; | ||
|
||
public using_database_per_tenant( | ||
ITestOutputHelper testOutputHelper | ||
) => _testOutputHelper = testOutputHelper; | ||
|
||
public async Task InitializeAsync() | ||
{ | ||
_theStore = DocumentStore.For( | ||
options => | ||
{ | ||
options.MultiTenantedWithSingleServer(ConnectionSource.ConnectionString); | ||
} | ||
); | ||
} | ||
|
||
[Fact] | ||
public async Task should_not_meaning_ful_exception_when_tenant_id_is_missing() | ||
{ | ||
Should.Throw<ArgumentNullException>(() => _theStore.LightweightSession()); | ||
} | ||
|
||
|
||
public async Task DisposeAsync() => await _theStore.DisposeAsync(); | ||
} |