mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15: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
+9
-11
@@ -1,8 +1,8 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Application.Common.Mapping.Common.Metadata;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.Fixtures.Common.ValueObjects.Metadata;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
@@ -16,13 +16,13 @@ namespace Lumina.Application.UnitTests.Common.Mapping.Common.Metadata;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GenreMappingTests
|
||||
{
|
||||
private readonly GenreFixture _genreFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToRepositoryEntity_WhenMappingGenre_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
Result<Genre> createResult = Genre.Create("Rock");
|
||||
Assert.False(createResult.IsFailure);
|
||||
Genre genre = createResult.Value;
|
||||
Genre genre = _genreFixture.Create("Rock");
|
||||
|
||||
// Act
|
||||
GenreEntity result = genre.ToRepositoryEntity();
|
||||
@@ -40,9 +40,7 @@ public class GenreMappingTests
|
||||
public void ToRepositoryEntity_WhenMappingDifferentGenres_ShouldMapCorrectly(string name)
|
||||
{
|
||||
// Arrange
|
||||
Result<Genre> createResult = Genre.Create(name);
|
||||
Assert.False(createResult.IsFailure);
|
||||
Genre genre = createResult.Value;
|
||||
Genre genre = _genreFixture.Create(name);
|
||||
|
||||
// Act
|
||||
GenreEntity result = genre.ToRepositoryEntity();
|
||||
@@ -58,10 +56,10 @@ public class GenreMappingTests
|
||||
// Arrange
|
||||
List<Genre> genres =
|
||||
[
|
||||
Genre.Create("Rock").Value,
|
||||
Genre.Create("Jazz").Value,
|
||||
Genre.Create("Classical").Value,
|
||||
Genre.Create("Pop").Value
|
||||
_genreFixture.Create("Rock"),
|
||||
_genreFixture.Create("Jazz"),
|
||||
_genreFixture.Create("Classical"),
|
||||
_genreFixture.Create("Pop")
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
+10
-12
@@ -1,8 +1,8 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Application.Common.Mapping.Common.Metadata;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.Fixtures.Common.ValueObjects.Metadata;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
@@ -16,13 +16,13 @@ namespace Lumina.Application.UnitTests.Common.Mapping.Common.Metadata;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class TagMappingTests
|
||||
{
|
||||
private readonly TagFixture _tagFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToRepositoryEntity_WhenMappingTag_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
Result<Tag> createResult = Tag.Create("indie");
|
||||
Assert.False(createResult.IsFailure);
|
||||
Tag tag = createResult.Value;
|
||||
Tag tag = _tagFixture.Create("indie");
|
||||
|
||||
// Act
|
||||
TagEntity result = tag.ToRepositoryEntity();
|
||||
@@ -41,9 +41,7 @@ public class TagMappingTests
|
||||
public void ToRepositoryEntity_WhenMappingDifferentTags_ShouldMapCorrectly(string name)
|
||||
{
|
||||
// Arrange
|
||||
Result<Tag> createResult = Tag.Create(name);
|
||||
Assert.False(createResult.IsFailure);
|
||||
Tag tag = createResult.Value;
|
||||
Tag tag = _tagFixture.Create(name);
|
||||
|
||||
// Act
|
||||
TagEntity result = tag.ToRepositoryEntity();
|
||||
@@ -59,11 +57,11 @@ public class TagMappingTests
|
||||
// Arrange
|
||||
List<Tag> tags =
|
||||
[
|
||||
Tag.Create("indie").Value,
|
||||
Tag.Create("electronic").Value,
|
||||
Tag.Create("instrumental").Value,
|
||||
Tag.Create("live").Value,
|
||||
Tag.Create("acoustic").Value
|
||||
_tagFixture.Create("indie"),
|
||||
_tagFixture.Create("electronic"),
|
||||
_tagFixture.Create("instrumental"),
|
||||
_tagFixture.Create("live"),
|
||||
_tagFixture.Create("acoustic")
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
Reference in new issue
Block a user