mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Adds AddBook unit tests
This commit is contained in:
1 parent
bd2880457c
commit
a3e956a165
12 files changed
+2579
-13
No files matched your search
+2
-2
@@ -26,7 +26,7 @@ public class BooksControllerTests : IClassFixture<LuminaApiFactory>
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly LuminaApiFactory _apiFactory;
|
||||
private readonly HttpClient _client;
|
||||
private readonly RequestBookFixture _requestBookFixture;
|
||||
private readonly AddBookRequestFixture _requestBookFixture;
|
||||
private readonly JsonSerializerOptions _jsonOptions = new();
|
||||
#endregion
|
||||
|
||||
@@ -39,7 +39,7 @@ public class BooksControllerTests : IClassFixture<LuminaApiFactory>
|
||||
{
|
||||
_apiFactory = apiFactory;
|
||||
_client = _apiFactory.CreateClient();
|
||||
_requestBookFixture = new RequestBookFixture();
|
||||
_requestBookFixture = new AddBookRequestFixture();
|
||||
_jsonOptions.Converters.Add(new BookJsonConverter());
|
||||
}
|
||||
#endregion
|
||||
|
||||
+4
-8
@@ -13,10 +13,10 @@ using System.Diagnostics.CodeAnalysis;
|
||||
namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.Books.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BooksControllerTests"/> class.
|
||||
/// Fixture class for the <see cref="AddBookRequest"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class RequestBookFixture
|
||||
public class AddBookRequestFixture
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly Fixture _fixture;
|
||||
@@ -26,9 +26,9 @@ public class RequestBookFixture
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequestBookFixture"/> class.
|
||||
/// Initializes a new instance of the <see cref="AddBookRequestFixture"/> class.
|
||||
/// </summary>
|
||||
public RequestBookFixture()
|
||||
public AddBookRequestFixture()
|
||||
{
|
||||
_fixture = new Fixture();
|
||||
_fixture.Customizations.Add(new DateOnlySpecimenBuilder());
|
||||
@@ -271,10 +271,6 @@ public class RequestBookFixture
|
||||
var releaseYear = _random.Next(2000, 2010);
|
||||
var reReleaseYear = _random.Next(2010, 2020);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
_fixture.Register(() => new ReleaseInfoDto(
|
||||
_faker.DateOnlyBetween(new DateOnly(releaseYear, 1, 1), new DateOnly(releaseYear, 12, 31)),
|
||||
releaseYear,
|
||||
+1
-1
@@ -14,7 +14,7 @@ using System.Diagnostics.CodeAnalysis;
|
||||
namespace Lumina.Presentation.Api.IntegrationTests.Core.Controllers.Books.Fixtures;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BooksControllerTests"/> class.
|
||||
/// Fixture class for the <see cref="Book"/> domain entity.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class DomainBookFixture
|
||||
|
||||
Reference in new issue
Block a user