mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Cleaning namespaces and adding episodes tests
This commit is contained in:
parent
d7d40aef24
commit
d2f774e32d
@ -16,7 +16,6 @@
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="Xunit.Extensions.Ordering" Version="1.4.5" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
32
Kyoo.Tests/Library/SpecificTests/EpisodeTest.cs
Normal file
32
Kyoo.Tests/Library/SpecificTests/EpisodeTest.cs
Normal file
@ -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<Episode>
|
||||
{
|
||||
protected AEpisodeTests(RepositoryActivator repositories)
|
||||
: base(repositories)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -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
|
||||
{
|
||||
|
@ -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<PostgresFixture>
|
||||
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<Season>
|
||||
|
||||
public abstract class ASeasonTests : RepositoryTests<Season>
|
||||
{
|
||||
private readonly ISeasonRepository _repository;
|
||||
|
||||
protected SeasonTests(RepositoryActivator repositories)
|
||||
protected ASeasonTests(RepositoryActivator repositories)
|
||||
: base(repositories)
|
||||
{
|
||||
_repository = Repositories.LibraryManager.SeasonRepository;
|
||||
|
@ -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<PostgresFixture>
|
||||
|
||||
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<Show>
|
||||
|
||||
public abstract class AShowTests : RepositoryTests<Show>
|
||||
{
|
||||
private readonly IShowRepository _repository;
|
||||
|
||||
protected ShowTests(RepositoryActivator repositories)
|
||||
protected AShowTests(RepositoryActivator repositories)
|
||||
: base(repositories)
|
||||
{
|
||||
_repository = Repositories.LibraryManager.ShowRepository;
|
||||
|
@ -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<PostgresFixture>
|
||||
{}
|
||||
|
||||
public sealed class PostgresFixture : IDisposable
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user