Skip to content

Commit

Permalink
[.NET] Move all tests that touch LibCantera into the same collection
Browse files Browse the repository at this point in the history
Due to an idiosyncrasy in the native lib, separate loggers are created per thread. We need all tests that call the native lib to be on the same thread to ensure the LogWriter_MessageLogged test passes.
  • Loading branch information
burkenyo committed Aug 20, 2023
1 parent 6d3e101 commit 689266a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion interfaces/dotnet/Cantera.Tests/src/ApplicationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Cantera.Tests;

[Collection("Application")]
[Collection(LibCanteraFixture.Collection)]
public class ApplicationTest
{
class FooException : Exception { }
Expand Down
1 change: 1 addition & 0 deletions interfaces/dotnet/Cantera.Tests/src/ExceptionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Cantera.Tests;

[Collection(LibCanteraFixture.Collection)]
public class ExceptionTest
{
class FooException : Exception { }
Expand Down
10 changes: 6 additions & 4 deletions interfaces/dotnet/Cantera.Tests/src/TestFixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

namespace Cantera.Tests;

public class ApplicationFixture
public class LibCanteraFixture
{
public ApplicationFixture()
internal const string Collection = "LibCantera";

public LibCanteraFixture()
{
Application.DataDirectories.AddAssemblyDirectory();
}
}

[CollectionDefinition("Application")]
public class DatabaseCollection : ICollectionFixture<ApplicationFixture> { }
[CollectionDefinition(LibCanteraFixture.Collection)]
public class LibCanteraCollection : ICollectionFixture<LibCanteraFixture> { }
2 changes: 1 addition & 1 deletion interfaces/dotnet/Cantera.Tests/src/ThermoPhaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Cantera.Tests;

[Collection("Application")]
[Collection(LibCanteraFixture.Collection)]
public class ThermoPhaseTest
{
[Fact]
Expand Down

0 comments on commit 689266a

Please sign in to comment.