diff --git a/Kyoo.Tests/Kyoo.Tests.csproj b/Kyoo.Tests/Kyoo.Tests.csproj
index 9d1e8311..265ccb98 100644
--- a/Kyoo.Tests/Kyoo.Tests.csproj
+++ b/Kyoo.Tests/Kyoo.Tests.csproj
@@ -16,7 +16,6 @@
-
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/Kyoo.Tests/Library/SpecificTests/EpisodeTest.cs b/Kyoo.Tests/Library/SpecificTests/EpisodeTest.cs
new file mode 100644
index 00000000..a7b3d743
--- /dev/null
+++ b/Kyoo.Tests/Library/SpecificTests/EpisodeTest.cs
@@ -0,0 +1,32 @@
+using Kyoo.Models;
+using Xunit;
+
+namespace Kyoo.Tests.Library
+{
+ namespace SqLite
+ {
+ public class EpisodeTests : AEpisodeTests
+ {
+ public EpisodeTests()
+ : base(new RepositoryActivator()) { }
+ }
+ }
+
+
+ namespace PostgreSQL
+ {
+ [Collection(nameof(Postgresql))]
+ public class EpisodeTests : AEpisodeTests
+ {
+ public EpisodeTests(PostgresFixture postgres)
+ : base(new RepositoryActivator(postgres)) { }
+ }
+ }
+
+ public abstract class AEpisodeTests : RepositoryTests
+ {
+ protected AEpisodeTests(RepositoryActivator repositories)
+ : base(repositories)
+ { }
+ }
+}
\ No newline at end of file
diff --git a/Kyoo.Tests/Library/SpecificTests/SanityTests.cs b/Kyoo.Tests/Library/SpecificTests/SanityTests.cs
index 7d7794fa..098c4677 100644
--- a/Kyoo.Tests/Library/SpecificTests/SanityTests.cs
+++ b/Kyoo.Tests/Library/SpecificTests/SanityTests.cs
@@ -1,11 +1,10 @@
using System;
using System.Diagnostics.CodeAnalysis;
-using System.Linq;
using System.Threading.Tasks;
using Kyoo.Models;
using Xunit;
-namespace Kyoo.Tests.SpecificTests
+namespace Kyoo.Tests.Library
{
public class GlobalTests : IDisposable, IAsyncDisposable
{
diff --git a/Kyoo.Tests/Library/SpecificTests/SeasonTests.cs b/Kyoo.Tests/Library/SpecificTests/SeasonTests.cs
index 7f81bc3f..0c912d07 100644
--- a/Kyoo.Tests/Library/SpecificTests/SeasonTests.cs
+++ b/Kyoo.Tests/Library/SpecificTests/SeasonTests.cs
@@ -2,30 +2,34 @@ using System.Threading.Tasks;
using Kyoo.Controllers;
using Kyoo.Models;
using Xunit;
-using Xunit.Extensions.Ordering;
-namespace Kyoo.Tests.SpecificTests
+namespace Kyoo.Tests.Library
{
- public class SqLiteSeasonTests : SeasonTests
+ namespace SqLite
{
- public SqLiteSeasonTests()
- : base(new RepositoryActivator())
- { }
+ public class SeasonTests : ASeasonTests
+ {
+ public SeasonTests()
+ : base(new RepositoryActivator()) { }
+ }
}
- public class PostgresSeasonTests : SeasonTests, IAssemblyFixture
+ namespace PostgreSQL
{
- public PostgresSeasonTests(PostgresFixture postgres)
- : base(new RepositoryActivator(postgres))
- { }
+ [Collection(nameof(Postgresql))]
+ public class SeasonTests : ASeasonTests
+ {
+ public SeasonTests(PostgresFixture postgres)
+ : base(new RepositoryActivator(postgres)) { }
+ }
}
-
- public abstract class SeasonTests : RepositoryTests
+
+ public abstract class ASeasonTests : RepositoryTests
{
private readonly ISeasonRepository _repository;
- protected SeasonTests(RepositoryActivator repositories)
+ protected ASeasonTests(RepositoryActivator repositories)
: base(repositories)
{
_repository = Repositories.LibraryManager.SeasonRepository;
diff --git a/Kyoo.Tests/Library/SpecificTests/ShowTests.cs b/Kyoo.Tests/Library/SpecificTests/ShowTests.cs
index d16f13e9..facb8e81 100644
--- a/Kyoo.Tests/Library/SpecificTests/ShowTests.cs
+++ b/Kyoo.Tests/Library/SpecificTests/ShowTests.cs
@@ -6,29 +6,33 @@ using Kyoo.Controllers;
using Kyoo.Models;
using Microsoft.EntityFrameworkCore;
using Xunit;
-using Xunit.Extensions.Ordering;
-namespace Kyoo.Tests.SpecificTests
+namespace Kyoo.Tests.Library
{
- public class SqLiteShowTests : ShowTests
+ namespace SqLite
{
- public SqLiteShowTests()
- : base(new RepositoryActivator())
- { }
+ public class ShowTests : AShowTests
+ {
+ public ShowTests()
+ : base(new RepositoryActivator()) { }
+ }
}
-
- public class PostgresShowTests : ShowTests, IAssemblyFixture
+
+ namespace PostgreSQL
{
- public PostgresShowTests(PostgresFixture postgres)
- : base(new RepositoryActivator(postgres))
- { }
+ [Collection(nameof(Postgresql))]
+ public class ShowTests : AShowTests
+ {
+ public ShowTests(PostgresFixture postgres)
+ : base(new RepositoryActivator(postgres)) { }
+ }
}
-
- public abstract class ShowTests : RepositoryTests
+
+ public abstract class AShowTests : RepositoryTests
{
private readonly IShowRepository _repository;
- protected ShowTests(RepositoryActivator repositories)
+ protected AShowTests(RepositoryActivator repositories)
: base(repositories)
{
_repository = Repositories.LibraryManager.ShowRepository;
diff --git a/Kyoo.Tests/Library/TestContext.cs b/Kyoo.Tests/Library/TestContext.cs
index 82406454..61332a8d 100644
--- a/Kyoo.Tests/Library/TestContext.cs
+++ b/Kyoo.Tests/Library/TestContext.cs
@@ -8,8 +8,6 @@ using Microsoft.Extensions.Logging;
using Npgsql;
using Xunit;
-[assembly: TestFramework("Xunit.Extensions.Ordering.TestFramework", "Xunit.Extensions.Ordering")]
-
namespace Kyoo.Tests
{
public sealed class SqLiteTestContext : TestContext
@@ -56,6 +54,10 @@ namespace Kyoo.Tests
return new SqLiteContext(_context);
}
}
+
+ [CollectionDefinition(nameof(Postgresql))]
+ public class PostgresCollection : ICollectionFixture
+ {}
public sealed class PostgresFixture : IDisposable
{