mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09:11:10 +00:00
Hardens test assertions and adds missing test coverage.
This commit is contained in:
1 parent
6b86fd5805
commit
1189bbaf36
489 files changed
+39982
-512
No files matched your search
+120
@@ -0,0 +1,120 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Entities;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookSeries"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookSeriesTests
|
||||
{
|
||||
private readonly BookFixture _bookFixture = new();
|
||||
private readonly BookSeriesIdFixture _bookSeriesIdFixture = new();
|
||||
private readonly WrittenContentMetadataFixture _writtenContentMetadataFixture = new();
|
||||
private readonly BookSeriesFixture _bookSeriesFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidData_ShouldCreateSeries()
|
||||
{
|
||||
// Act
|
||||
Result<BookSeries> result = BookSeries.Create(_writtenContentMetadataFixture.Create(), isComplete: false, []);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.False(result.Value.IsComplete);
|
||||
Assert.Empty(result.Value.Books);
|
||||
Assert.NotEqual(default, result.Value.Id.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithPreExistingId_ShouldCreateSeriesWithThatId()
|
||||
{
|
||||
// Arrange
|
||||
Guid id = Guid.NewGuid();
|
||||
|
||||
// Act
|
||||
Result<BookSeries> result = BookSeries.Create(_bookSeriesIdFixture.Create(id), _writtenContentMetadataFixture.Create(), isComplete: true, []);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(id, result.Value.Id.Value);
|
||||
Assert.True(result.Value.IsComplete);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddBook_WhenBookIsNotInSeries_ShouldAddBookAndReturnCreated()
|
||||
{
|
||||
// Arrange
|
||||
BookSeries series = _bookSeriesFixture.Create();
|
||||
Book book = _bookFixture.Create();
|
||||
|
||||
// Act
|
||||
Result<Created> result = series.AddBook(book);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(Result.Created, result.Value);
|
||||
Assert.Single(series.Books);
|
||||
Assert.Contains(book, series.Books);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddBook_WhenBookIsAlreadyInSeries_ShouldReturnError()
|
||||
{
|
||||
// Arrange
|
||||
BookSeries series = _bookSeriesFixture.Create();
|
||||
Book book = _bookFixture.Create();
|
||||
series.AddBook(book);
|
||||
|
||||
// Act
|
||||
Result<Created> result = series.AddBook(book);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.TheBookIsAlreadyInTheSeries, result.FirstError);
|
||||
Assert.Single(series.Books);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RemoveBook_WhenBookIsInSeries_ShouldRemoveBookAndReturnDeleted()
|
||||
{
|
||||
// Arrange
|
||||
BookSeries series = _bookSeriesFixture.Create();
|
||||
Book book = _bookFixture.Create();
|
||||
series.AddBook(book);
|
||||
|
||||
// Act
|
||||
Result<Deleted> result = series.RemoveBook(book);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(Result.Deleted, result.Value);
|
||||
Assert.Empty(series.Books);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RemoveBook_WhenBookIsNotInSeries_ShouldReturnError()
|
||||
{
|
||||
// Arrange
|
||||
BookSeries series = _bookSeriesFixture.Create();
|
||||
Book book = _bookFixture.Create();
|
||||
|
||||
// Act
|
||||
Result<Deleted> result = series.RemoveBook(book);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.TheBookIsNotInTheSeries, result.FirstError);
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void Books_WhenAccessed_ShouldThrowNotImplementedException()
|
||||
{
|
||||
// Arrange
|
||||
BookLibraryService sut = new();
|
||||
|
||||
// Act & Assert
|
||||
Assert.Throws<NotImplementedException>(() => sut.Books);
|
||||
}
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryScanAggregate.Services.Jobs;
|
||||
using Lumina.Domain.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryScanAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.UserManagementBoundedContext.UserAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services.Jobs;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services.Scanners;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.LibraryManagementBoundedContext.LibraryScanAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.UserManagementBoundedContext.UserAggregate.ValueObjects;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services.Scanners;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookLibraryTypeScanner"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookLibraryTypeScannerTests
|
||||
{
|
||||
private readonly IMediaLibraryScanJobFactory _mockJobFactory = Substitute.For<IMediaLibraryScanJobFactory>();
|
||||
private readonly LibraryIdFixture _libraryIdFixture = new();
|
||||
private readonly ScanIdFixture _scanIdFixture = new();
|
||||
private readonly UserIdFixture _userIdFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void SupportedLibraryType_ShouldBeBook()
|
||||
{
|
||||
// Arrange
|
||||
BookLibraryTypeScanner sut = new(_mockJobFactory);
|
||||
|
||||
// Act & Assert
|
||||
Assert.Equal(LibraryType.Book, sut.SupportedLibraryType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateScanJobsForLibrary_WhenDownloadMetadataFromWebIsFalse_ShouldCreateJobChainWithoutMetadataEnrichment()
|
||||
{
|
||||
// Arrange
|
||||
LibraryId libraryId = _libraryIdFixture.Create();
|
||||
TestScanJob discoveryJob = CreateJob<IBooksFileSystemDiscoveryJob>();
|
||||
TestScanJob diffJob = CreateJob<IMediaLibraryScanDiffJob>();
|
||||
TestScanJob hashJob = CreateJob<IMediaLibraryScanHashJob>();
|
||||
TestScanJob saveJob = CreateJob<IMediaLibraryScanResultsSaveJob>();
|
||||
BookLibraryTypeScanner sut = new(_mockJobFactory);
|
||||
|
||||
// Act
|
||||
List<IMediaLibraryScanJob> rootJobs = [.. sut.CreateScanJobsForLibrary(libraryId, downloadMetadataFromWeb: false)];
|
||||
|
||||
// Assert
|
||||
IMediaLibraryScanJob rootJob = Assert.Single(rootJobs);
|
||||
Assert.Same(discoveryJob, rootJob);
|
||||
Assert.Contains(diffJob, discoveryJob.Children);
|
||||
Assert.Contains(discoveryJob, diffJob.Parents);
|
||||
Assert.Contains(hashJob, diffJob.Children);
|
||||
Assert.Contains(diffJob, hashJob.Parents);
|
||||
Assert.Contains(saveJob, hashJob.Children);
|
||||
Assert.Contains(hashJob, saveJob.Parents);
|
||||
_mockJobFactory.DidNotReceive().CreateJob<IMediaLibraryScanMetadataEnrichmentJob>(Arg.Any<LibraryId>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateScanJobsForLibrary_WhenDownloadMetadataFromWebIsTrue_ShouldCreateJobChainWithMetadataEnrichment()
|
||||
{
|
||||
// Arrange
|
||||
LibraryId libraryId = _libraryIdFixture.Create();
|
||||
TestScanJob discoveryJob = CreateJob<IBooksFileSystemDiscoveryJob>();
|
||||
TestScanJob diffJob = CreateJob<IMediaLibraryScanDiffJob>();
|
||||
TestScanJob hashJob = CreateJob<IMediaLibraryScanHashJob>();
|
||||
TestScanJob saveJob = CreateJob<IMediaLibraryScanResultsSaveJob>();
|
||||
TestScanJob enrichmentJob = CreateJob<IMediaLibraryScanMetadataEnrichmentJob>();
|
||||
BookLibraryTypeScanner sut = new(_mockJobFactory);
|
||||
|
||||
// Act
|
||||
List<IMediaLibraryScanJob> rootJobs = [.. sut.CreateScanJobsForLibrary(libraryId, downloadMetadataFromWeb: true)];
|
||||
|
||||
// Assert
|
||||
IMediaLibraryScanJob rootJob = Assert.Single(rootJobs);
|
||||
Assert.Same(discoveryJob, rootJob);
|
||||
Assert.Contains(saveJob, hashJob.Children);
|
||||
Assert.Contains(enrichmentJob, saveJob.Children);
|
||||
Assert.Contains(saveJob, enrichmentJob.Parents);
|
||||
_mockJobFactory.Received(1).CreateJob<IMediaLibraryScanMetadataEnrichmentJob>(libraryId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreateScanJobsForLibrary_WhenCalled_ShouldCreateJobsForTheLibrary()
|
||||
{
|
||||
// Arrange
|
||||
LibraryId libraryId = _libraryIdFixture.Create();
|
||||
CreateJob<IBooksFileSystemDiscoveryJob>();
|
||||
CreateJob<IMediaLibraryScanDiffJob>();
|
||||
CreateJob<IMediaLibraryScanHashJob>();
|
||||
CreateJob<IMediaLibraryScanResultsSaveJob>();
|
||||
BookLibraryTypeScanner sut = new(_mockJobFactory);
|
||||
|
||||
// Act
|
||||
_ = sut.CreateScanJobsForLibrary(libraryId, downloadMetadataFromWeb: false).ToList();
|
||||
|
||||
// Assert
|
||||
_mockJobFactory.Received(1).CreateJob<IBooksFileSystemDiscoveryJob>(libraryId);
|
||||
_mockJobFactory.Received(1).CreateJob<IMediaLibraryScanDiffJob>(libraryId);
|
||||
_mockJobFactory.Received(1).CreateJob<IMediaLibraryScanHashJob>(libraryId);
|
||||
_mockJobFactory.Received(1).CreateJob<IMediaLibraryScanResultsSaveJob>(libraryId);
|
||||
}
|
||||
|
||||
private TestScanJob CreateJob<TJob>() where TJob : class, IMediaLibraryScanJob
|
||||
{
|
||||
TestScanJob job = new()
|
||||
{
|
||||
ScanId = _scanIdFixture.Create(),
|
||||
UserId = _userIdFixture.Create(),
|
||||
LibraryId = _libraryIdFixture.Create()
|
||||
};
|
||||
_mockJobFactory.CreateJob<TJob>(Arg.Any<LibraryId>()).Returns((TJob)(object)job);
|
||||
return job;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Concrete test implementation of the abstract <see cref="MediaLibraryScanJob"/> class that satisfies all job interfaces.
|
||||
/// </summary>
|
||||
private sealed class TestScanJob : MediaLibraryScanJob,
|
||||
IBooksFileSystemDiscoveryJob,
|
||||
IMediaLibraryScanDiffJob,
|
||||
IMediaLibraryScanHashJob,
|
||||
IMediaLibraryScanResultsSaveJob,
|
||||
IMediaLibraryScanMetadataEnrichmentJob
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes the payload of the media library scan job.
|
||||
/// </summary>
|
||||
/// <typeparam name="TInput">The type of the input parameter.</typeparam>
|
||||
/// <param name="id">The unique identifier of the media library scan job.</param>
|
||||
/// <param name="input">The input data to be processed.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
public override Task ExecuteAsync<TInput>(Guid id, TInput input, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookId"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookIdTests
|
||||
{
|
||||
private readonly BookIdFixture _bookIdFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void CreateUnique_WhenCalled_ShouldReturnIdWithNonEmptyValue()
|
||||
{
|
||||
// Act
|
||||
BookId bookId = BookId.CreateUnique();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(bookId);
|
||||
Assert.NotEqual(default, bookId.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValue_ShouldReturnIdWithThatValue()
|
||||
{
|
||||
// Arrange
|
||||
Guid value = Guid.NewGuid();
|
||||
|
||||
// Act
|
||||
BookId bookId = BookId.Create(value);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, bookId.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithSameValue_ShouldReturnTrue()
|
||||
{
|
||||
// Arrange
|
||||
Guid value = Guid.NewGuid();
|
||||
BookId firstId = _bookIdFixture.Create(value);
|
||||
BookId secondId = _bookIdFixture.Create(value);
|
||||
|
||||
// Act
|
||||
bool result = firstId.Equals(secondId);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithDifferentValue_ShouldReturnFalse()
|
||||
{
|
||||
// Arrange
|
||||
BookId firstId = _bookIdFixture.Create();
|
||||
BookId secondId = _bookIdFixture.Create();
|
||||
|
||||
// Act
|
||||
bool result = firstId.Equals(secondId);
|
||||
|
||||
// Assert
|
||||
Assert.False(result);
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookLibraryId"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookLibraryIdTests
|
||||
{
|
||||
private readonly BookLibraryIdFixture _bookLibraryIdFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void CreateUnique_WhenCalled_ShouldReturnIdWithNonEmptyValue()
|
||||
{
|
||||
// Act
|
||||
Result<BookLibraryId> result = BookLibraryId.CreateUnique();
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.NotEqual(default, result.Value.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValue_ShouldReturnIdWithThatValue()
|
||||
{
|
||||
// Arrange
|
||||
Guid value = Guid.NewGuid();
|
||||
|
||||
// Act
|
||||
Result<BookLibraryId> result = BookLibraryId.Create(value);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(value, result.Value.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithSameValue_ShouldReturnTrue()
|
||||
{
|
||||
// Arrange
|
||||
Guid value = Guid.NewGuid();
|
||||
BookLibraryId firstId = _bookLibraryIdFixture.Create(value);
|
||||
BookLibraryId secondId = _bookLibraryIdFixture.Create(value);
|
||||
|
||||
// Act
|
||||
bool result = firstId.Equals(secondId);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithDifferentValue_ShouldReturnFalse()
|
||||
{
|
||||
// Arrange
|
||||
BookLibraryId firstId = _bookLibraryIdFixture.Create();
|
||||
BookLibraryId secondId = _bookLibraryIdFixture.Create();
|
||||
|
||||
// Act
|
||||
bool result = firstId.Equals(secondId);
|
||||
|
||||
// Assert
|
||||
Assert.False(result);
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookRating"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookRatingTests
|
||||
{
|
||||
private readonly BookRatingFixture _bookRatingFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidValues_ShouldCreateRating()
|
||||
{
|
||||
// Act
|
||||
Result<BookRating> result = BookRating.Create(
|
||||
value: 4.5m,
|
||||
maxValue: 5,
|
||||
Optional<BookRatingSource>.Some(BookRatingSource.Goodreads),
|
||||
Optional<int>.Some(100));
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal(4.5m, result.Value.Value);
|
||||
Assert.Equal(5, result.Value.MaxValue);
|
||||
Assert.True(result.Value.Source.HasValue);
|
||||
Assert.Equal(BookRatingSource.Goodreads, result.Value.Source.Value);
|
||||
Assert.True(result.Value.VoteCount.HasValue);
|
||||
Assert.Equal(100, result.Value.VoteCount.Value);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // negative value
|
||||
[InlineData(-0.5)] // negative fractional value
|
||||
public void Create_WhenValueIsNegative_ShouldReturnError(double value)
|
||||
{
|
||||
// Act
|
||||
Result<BookRating> result = BookRating.Create((decimal)value, maxValue: 5, Optional<BookRatingSource>.None(), Optional<int>.None());
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.Metadata.RatingValueMustBePositive, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenMaxValueIsNegative_ShouldReturnError()
|
||||
{
|
||||
// Act
|
||||
Result<BookRating> result = BookRating.Create(value: 4.5m, maxValue: -5, Optional<BookRatingSource>.None(), Optional<int>.None());
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.Metadata.RatingValueMustBePositive, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenValueExceedsMaxValue_ShouldReturnError()
|
||||
{
|
||||
// Act
|
||||
Result<BookRating> result = BookRating.Create(value: 6, maxValue: 5, Optional<BookRatingSource>.None(), Optional<int>.None());
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.Metadata.RatingValueCannotBeGreaterThanMaxValue, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AsPercentage_WhenCalled_ShouldReturnValueAsPercentageOfMaxValue()
|
||||
{
|
||||
// Arrange
|
||||
BookRating rating = _bookRatingFixture.Create(value: 4.5m, maxValue: 5);
|
||||
|
||||
// Act
|
||||
decimal result = rating.AsPercentage();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(90, result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToString_WhenSourceAndVoteCountArePresent_ShouldIncludeThem()
|
||||
{
|
||||
// Arrange
|
||||
BookRating rating = _bookRatingFixture.Create(
|
||||
value: 4.5m,
|
||||
maxValue: 5,
|
||||
source: Optional<BookRatingSource>.Some(BookRatingSource.Goodreads),
|
||||
voteCount: Optional<int>.Some(100));
|
||||
|
||||
// Act
|
||||
string result = rating.ToString();
|
||||
|
||||
// Assert
|
||||
Assert.Equal("4.5/5 (Goodreads) [100 votes]", result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToString_WhenSourceAndVoteCountAreAbsent_ShouldReturnBaseString()
|
||||
{
|
||||
// Arrange
|
||||
BookRating rating = _bookRatingFixture.Create(
|
||||
value: 4.5m,
|
||||
maxValue: 5,
|
||||
source: Optional<BookRatingSource>.None(),
|
||||
voteCount: Optional<int>.None());
|
||||
|
||||
// Act
|
||||
string result = rating.ToString();
|
||||
|
||||
// Assert
|
||||
Assert.Equal("4.5/5", result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithSameValues_ShouldReturnTrue()
|
||||
{
|
||||
// Arrange
|
||||
BookRating firstRating = _bookRatingFixture.Create(
|
||||
value: 4.5m,
|
||||
maxValue: 5,
|
||||
source: Optional<BookRatingSource>.Some(BookRatingSource.Goodreads),
|
||||
voteCount: Optional<int>.Some(100));
|
||||
BookRating secondRating = _bookRatingFixture.Create(
|
||||
value: 4.5m,
|
||||
maxValue: 5,
|
||||
source: Optional<BookRatingSource>.Some(BookRatingSource.Goodreads),
|
||||
voteCount: Optional<int>.Some(100));
|
||||
|
||||
// Act
|
||||
bool result = firstRating.Equals(secondRating);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="BookSeriesId"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookSeriesIdTests
|
||||
{
|
||||
private readonly BookSeriesIdFixture _bookSeriesIdFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void CreateUnique_WhenCalled_ShouldReturnIdWithNonEmptyValue()
|
||||
{
|
||||
// Act
|
||||
BookSeriesId seriesId = BookSeriesId.CreateUnique();
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(seriesId);
|
||||
Assert.NotEqual(default, seriesId.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValue_ShouldReturnIdWithThatValue()
|
||||
{
|
||||
// Arrange
|
||||
Guid value = Guid.NewGuid();
|
||||
|
||||
// Act
|
||||
BookSeriesId seriesId = BookSeriesId.Create(value);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(value, seriesId.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithSameValue_ShouldReturnTrue()
|
||||
{
|
||||
// Arrange
|
||||
Guid value = Guid.NewGuid();
|
||||
BookSeriesId firstId = _bookSeriesIdFixture.Create(value);
|
||||
BookSeriesId secondId = _bookSeriesIdFixture.Create(value);
|
||||
|
||||
// Act
|
||||
bool result = firstId.Equals(secondId);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithDifferentValue_ShouldReturnFalse()
|
||||
{
|
||||
// Arrange
|
||||
BookSeriesId firstId = _bookSeriesIdFixture.Create();
|
||||
BookSeriesId secondId = _bookSeriesIdFixture.Create();
|
||||
|
||||
// Act
|
||||
bool result = firstId.Equals(secondId);
|
||||
|
||||
// Assert
|
||||
Assert.False(result);
|
||||
}
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="Isbn"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class IsbnTests
|
||||
{
|
||||
private readonly IsbnFixture _isbnFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidIsbn10_ShouldCreateIsbn10()
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create("0-306-40615-2", IsbnFormat.Isbn10);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal("0-306-40615-2", result.Value.Value);
|
||||
Assert.Equal(IsbnFormat.Isbn10, result.Value.Format);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidIsbn13_ShouldCreateIsbn13()
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create("978-0-306-40615-7", IsbnFormat.Isbn13);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal("978-0-306-40615-7", result.Value.Value);
|
||||
Assert.Equal(IsbnFormat.Isbn13, result.Value.Format);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // null ISBN value
|
||||
[InlineData("")] // empty ISBN value
|
||||
[InlineData(" ")] // whitespace ISBN value
|
||||
public void Create_WhenValueIsNullOrWhitespace_ShouldReturnError(string? value)
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create(value, IsbnFormat.Isbn10);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.IsbnValueCannotBeEmpty, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenFormatIsUnknown_ShouldReturnError()
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create("0-306-40615-2", (IsbnFormat)999);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.UnknownIsbnFormat, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenIsbn10HasInvalidCheckDigit_ShouldReturnError()
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create("0-306-40615-3", IsbnFormat.Isbn10);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.InvalidIsbn10Format, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenIsbn13HasInvalidCheckDigit_ShouldReturnError()
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create("978-0-306-40615-8", IsbnFormat.Isbn13);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.InvalidIsbn13Format, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenIsbn10HasWrongLength_ShouldReturnError()
|
||||
{
|
||||
// Act
|
||||
Result<Isbn> result = Isbn.Create("123456789", IsbnFormat.Isbn10);
|
||||
|
||||
// Assert
|
||||
Assert.True(result.IsFailure);
|
||||
Assert.Equal(DomainErrors.WrittenContent.InvalidIsbn10Format, result.FirstError);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0-306-40615-2")] // valid ISBN-10 with hyphens
|
||||
[InlineData("0306406152")] // valid ISBN-10 without hyphens
|
||||
public void IsValidIsbn10_WhenValueIsValid_ShouldReturnTrue(string isbn)
|
||||
{
|
||||
// Act
|
||||
bool result = Isbn.IsValidIsbn10(isbn);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0-306-40615-3")] // invalid check digit
|
||||
[InlineData("030640615")] // too short
|
||||
[InlineData("03064061523")] // too long
|
||||
[InlineData("")] // empty value
|
||||
[InlineData("ISBN 0-306-40615-2")] // ISBN prefix is not stripped by the checksum computation
|
||||
public void IsValidIsbn10_WhenValueIsInvalid_ShouldReturnFalse(string isbn)
|
||||
{
|
||||
// Act
|
||||
bool result = Isbn.IsValidIsbn10(isbn);
|
||||
|
||||
// Assert
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("978-0-306-40615-7")] // valid ISBN-13 with hyphens
|
||||
[InlineData("9780306406157")] // valid ISBN-13 without hyphens
|
||||
[InlineData("979-0-306-40615-6")] // valid ISBN-13 with 979 prefix
|
||||
public void IsValidIsbn13_WhenValueIsValid_ShouldReturnTrue(string isbn)
|
||||
{
|
||||
// Act
|
||||
bool result = Isbn.IsValidIsbn13(isbn);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("978-0-306-40615-8")] // invalid check digit
|
||||
[InlineData("978030640615")] // too short
|
||||
[InlineData("97803064061578")] // too long
|
||||
[InlineData("")] // empty value
|
||||
[InlineData("ISBN 978-0-306-40615-7")] // ISBN prefix is not stripped by the checksum computation
|
||||
public void IsValidIsbn13_WhenValueIsInvalid_ShouldReturnFalse(string isbn)
|
||||
{
|
||||
// Act
|
||||
bool result = Isbn.IsValidIsbn13(isbn);
|
||||
|
||||
// Assert
|
||||
Assert.False(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithSameValueAndFormat_ShouldReturnTrue()
|
||||
{
|
||||
// Arrange
|
||||
Isbn firstIsbn = _isbnFixture.Create(value: "0-306-40615-2", format: IsbnFormat.Isbn10);
|
||||
Isbn secondIsbn = _isbnFixture.Create(value: "0-306-40615-2", format: IsbnFormat.Isbn10);
|
||||
|
||||
// Act
|
||||
bool result = firstIsbn.Equals(secondIsbn);
|
||||
|
||||
// Assert
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithDifferentValue_ShouldReturnFalse()
|
||||
{
|
||||
// Arrange
|
||||
Isbn firstIsbn = _isbnFixture.Create();
|
||||
Isbn secondIsbn = _isbnFixture.Create();
|
||||
|
||||
// Act
|
||||
bool result = firstIsbn.Equals(secondIsbn);
|
||||
|
||||
// Assert
|
||||
Assert.False(result);
|
||||
}
|
||||
}
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WrittenContentMetadata"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class WrittenContentMetadataTests
|
||||
{
|
||||
private readonly GenreFixture _genreFixture = new();
|
||||
private readonly TagFixture _tagFixture = new();
|
||||
private readonly ReleaseInfoFixture _releaseInfoFixture = new();
|
||||
private readonly LanguageInfoFixture _languageInfoFixture = new();
|
||||
private readonly WrittenContentMetadataFixture _writtenContentMetadataFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithValidValues_ShouldCreateMetadataWithAllPropertiesSet()
|
||||
{
|
||||
// Act
|
||||
Result<WrittenContentMetadata> result = WrittenContentMetadata.Create(
|
||||
"Dune",
|
||||
Optional<string>.Some("Dune (Original)"),
|
||||
Optional<string>.Some("A classic science fiction novel."),
|
||||
_releaseInfoFixture.Create(),
|
||||
[_genreFixture.Create(name: "Science Fiction")],
|
||||
[_tagFixture.Create(name: "classic")],
|
||||
Optional<LanguageInfo>.Some(_languageInfoFixture.Create()),
|
||||
Optional<LanguageInfo>.None(),
|
||||
Optional<string>.Some("Chilton Books"),
|
||||
Optional<int>.Some(412));
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Equal("Dune", result.Value.Title);
|
||||
Assert.Equal("Dune (Original)", result.Value.OriginalTitle.Value);
|
||||
Assert.Equal("A classic science fiction novel.", result.Value.Description.Value);
|
||||
Assert.Single(result.Value.Genres);
|
||||
Assert.Single(result.Value.Tags);
|
||||
Assert.True(result.Value.Language.HasValue);
|
||||
Assert.False(result.Value.OriginalLanguage.HasValue);
|
||||
Assert.True(result.Value.Publisher.HasValue);
|
||||
Assert.Equal("Chilton Books", result.Value.Publisher.Value);
|
||||
Assert.True(result.Value.PageCount.HasValue);
|
||||
Assert.Equal(412, result.Value.PageCount.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_WhenCalledWithOptionalValuesAbsent_ShouldCreateMetadataWithoutThem()
|
||||
{
|
||||
// Act
|
||||
Result<WrittenContentMetadata> result = WrittenContentMetadata.Create(
|
||||
"Dune",
|
||||
Optional<string>.None(),
|
||||
Optional<string>.None(),
|
||||
_releaseInfoFixture.Create(),
|
||||
[],
|
||||
[],
|
||||
Optional<LanguageInfo>.None(),
|
||||
Optional<LanguageInfo>.None(),
|
||||
Optional<string>.None(),
|
||||
Optional<int>.None());
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.False(result.Value.OriginalTitle.HasValue);
|
||||
Assert.False(result.Value.Publisher.HasValue);
|
||||
Assert.False(result.Value.PageCount.HasValue);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithSameValues_ShouldReturnTrue()
|
||||
{
|
||||
// Arrange
|
||||
ReleaseInfo releaseInfo = _releaseInfoFixture.Create();
|
||||
|
||||
// Act
|
||||
WrittenContentMetadata firstResult = _writtenContentMetadataFixture.Create(
|
||||
title: "Dune",
|
||||
originalTitle: Optional<string>.None(),
|
||||
description: Optional<string>.None(),
|
||||
releaseInfo: releaseInfo,
|
||||
genres: [],
|
||||
tags: [],
|
||||
language: Optional<LanguageInfo>.None(),
|
||||
originalLanguage: Optional<LanguageInfo>.None(),
|
||||
publisher: Optional<string>.None(),
|
||||
pageCount: Optional<int>.None());
|
||||
WrittenContentMetadata secondResult = _writtenContentMetadataFixture.Create(
|
||||
title: "Dune",
|
||||
originalTitle: Optional<string>.None(),
|
||||
description: Optional<string>.None(),
|
||||
releaseInfo: releaseInfo,
|
||||
genres: [],
|
||||
tags: [],
|
||||
language: Optional<LanguageInfo>.None(),
|
||||
originalLanguage: Optional<LanguageInfo>.None(),
|
||||
publisher: Optional<string>.None(),
|
||||
pageCount: Optional<int>.None());
|
||||
|
||||
// Assert
|
||||
Assert.Equal(firstResult, secondResult);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WithDifferentPublisher_ShouldReturnFalse()
|
||||
{
|
||||
// Arrange
|
||||
ReleaseInfo releaseInfo = _releaseInfoFixture.Create();
|
||||
|
||||
// Act
|
||||
WrittenContentMetadata firstResult = _writtenContentMetadataFixture.Create(
|
||||
title: "Dune",
|
||||
originalTitle: Optional<string>.None(),
|
||||
description: Optional<string>.None(),
|
||||
releaseInfo: releaseInfo,
|
||||
genres: [],
|
||||
tags: [],
|
||||
language: Optional<LanguageInfo>.None(),
|
||||
originalLanguage: Optional<LanguageInfo>.None(),
|
||||
publisher: Optional<string>.None(),
|
||||
pageCount: Optional<int>.None());
|
||||
WrittenContentMetadata secondResult = _writtenContentMetadataFixture.Create(
|
||||
title: "Dune",
|
||||
originalTitle: Optional<string>.None(),
|
||||
description: Optional<string>.None(),
|
||||
releaseInfo: releaseInfo,
|
||||
genres: [],
|
||||
tags: [],
|
||||
language: Optional<LanguageInfo>.None(),
|
||||
originalLanguage: Optional<LanguageInfo>.None(),
|
||||
publisher: Optional<string>.Some("Other Publisher"),
|
||||
pageCount: Optional<int>.None());
|
||||
|
||||
// Assert
|
||||
Assert.NotEqual(firstResult, secondResult);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services;
|
||||
using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WrittenContentLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class WrittenContentLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_WhenCalled_ShouldSetInjectedService()
|
||||
{
|
||||
// Arrange
|
||||
IBookLibraryService bookLibraryService = Substitute.For<IBookLibraryService>();
|
||||
|
||||
// Act
|
||||
WrittenContentLibraryService sut = new(bookLibraryService);
|
||||
|
||||
// Assert
|
||||
Assert.Same(bookLibraryService, sut.BookLibraryService);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user