Skip to content

Commit 3967a4a

Browse files
author
Oleksii Sokol
committed
fix mongo container
1 parent b78ec8c commit 3967a4a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ManagedCode.Database.Tests/MongoDBTests/MongoDBCollectionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
namespace ManagedCode.Database.Tests.MongoDBTests;
1111

12-
//[Collection("MongoDB collection")]
12+
[Collection(nameof(MongoDBTestContainer))]
1313
public class MongoDBCollectionTests : BaseCollectionTests<ObjectId, TestMongoDBItem>
1414
{
15-
public MongoDBCollectionTests() : base(new MongoDBTestContainer())
15+
public MongoDBCollectionTests(MongoDBTestContainer container) : base(container)
1616
{
1717
}
1818
}

ManagedCode.Database.Tests/TestContainers/MongoDBTestContainer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
namespace ManagedCode.Database.Tests.TestContainers;
1616

17-
public class MongoDBTestContainer : ITestContainer<ObjectId, TestMongoDBItem>, IDisposable
17+
[CollectionDefinition(nameof(MongoDBTestContainer))]
18+
public class MongoDBTestContainer : ITestContainer<ObjectId, TestMongoDBItem>, ICollectionFixture<MongoDBTestContainer>, IDisposable
1819
{
1920
//private readonly ITestOutputHelper _testOutputHelper;
2021
private readonly TestcontainersContainer _mongoDBTestContainer;

0 commit comments

Comments
 (0)