Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: throw exception when tenant id is missing for when using database per tenant #3251

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/MultiTenancyTests/using_database_per_tenant.cs
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();
}
Loading