-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11e69ec
commit 8009132
Showing
5 changed files
with
67 additions
and
7 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
26 changes: 26 additions & 0 deletions
26
tests/Ephemerally.Azure.Cosmos.Tests/Fixtures/CosmosContainerFixtureTests.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,26 @@ | ||
using Ephemerally.Azure.Cosmos.Xunit; | ||
using Microsoft.Azure.Cosmos; | ||
using Shouldly; | ||
|
||
namespace Ephemerally.Azure.Cosmos.Tests.Fixtures; | ||
|
||
public class DefaultEphemeralCosmosContainerFixtureTests | ||
: CosmosContainerFixtureTests<DefaultEphemeralCosmosContainerFixture>; | ||
|
||
public abstract class CosmosContainerFixtureTests<TFixture> | ||
where TFixture : ICosmosContainerFixture<Container>, new() | ||
{ | ||
[Test] | ||
public async Task Fixture_provides_usable_cosmos_container() | ||
{ | ||
// Arrange | ||
await using var fixture = new TFixture(); | ||
await fixture.InitializeAsync(); | ||
|
||
// Act | ||
var exists = await fixture.Container.ExistsAsync(); | ||
|
||
// Assert | ||
exists.ShouldBeTrue(); | ||
} | ||
} |
20 changes: 19 additions & 1 deletion
20
tests/Ephemerally.Azure.Cosmos.Tests/Fixtures/CosmosDatabaseFixtureTests.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 |
---|---|---|
@@ -1,8 +1,26 @@ | ||
using Ephemerally.Azure.Cosmos.Xunit; | ||
using Microsoft.Azure.Cosmos; | ||
using Shouldly; | ||
|
||
namespace Ephemerally.Azure.Cosmos.Tests.Fixtures; | ||
|
||
public abstract class CosmosDatabaseFixtureTests<TFixture> where TFixture : EphemeralCosmosDatabaseFixture | ||
public class DefaultEphemeralCosmosDatabaseFixtureTests | ||
: CosmosDatabaseFixtureTests<DefaultEphemeralCosmosDatabaseFixture>; | ||
|
||
public abstract class CosmosDatabaseFixtureTests<TFixture> | ||
where TFixture : ICosmosDatabaseFixture<Database>, new() | ||
{ | ||
[Test] | ||
public async Task Fixture_provides_usable_cosmos_database() | ||
{ | ||
// Arrange | ||
await using var fixture = new TFixture(); | ||
await fixture.InitializeAsync(); | ||
|
||
// Act | ||
var exists = await fixture.Database.ExistsAsync(); | ||
|
||
// Assert | ||
exists.ShouldBeTrue(); | ||
} | ||
} |