mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Standardizes test conventions and documentation
This commit is contained in:
1 parent
7aeed04255
commit
f42dc709de
190 files changed
+2180
-2814
No files matched your search
+14
-11
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.Mapping.Common.Metadata;
|
||||
using Lumina.Contracts.DTO.Common;
|
||||
using Lumina.Contracts.Fixtures.Core.DTO.Common;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,11 +17,13 @@ namespace Lumina.Application.UnitTests.Common.Mapping.Common.Metadata;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GenreDtoMappingTests
|
||||
{
|
||||
private readonly GenreDtoFixture _genreDtoFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToDomainEntity_WhenMappingValidGenreDto_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
GenreDto genreDto = new("Rock");
|
||||
GenreDto genreDto = _genreDtoFixture.Create(name: "Rock");
|
||||
|
||||
// Act
|
||||
Result<Genre> result = genreDto.ToDomainEntity();
|
||||
@@ -39,7 +42,7 @@ public class GenreDtoMappingTests
|
||||
public void ToDomainEntity_WhenMappingDifferentValidGenreDtos_ShouldMapCorrectly(string name)
|
||||
{
|
||||
// Arrange
|
||||
GenreDto genreDto = new(name);
|
||||
GenreDto genreDto = _genreDtoFixture.Create(name: name);
|
||||
|
||||
// Act
|
||||
Result<Genre> result = genreDto.ToDomainEntity();
|
||||
@@ -57,7 +60,7 @@ public class GenreDtoMappingTests
|
||||
public void ToDomainEntity_WhenMappingInvalidGenreDto_ShouldReturnError(string? invalidName)
|
||||
{
|
||||
// Arrange
|
||||
GenreDto genreDto = new(invalidName);
|
||||
GenreDto genreDto = _genreDtoFixture.Create(name: invalidName, includeName: invalidName is not null);
|
||||
|
||||
// Act
|
||||
Result<Genre> result = genreDto.ToDomainEntity();
|
||||
@@ -72,10 +75,10 @@ public class GenreDtoMappingTests
|
||||
// Arrange
|
||||
List<GenreDto> genreDtos =
|
||||
[
|
||||
new GenreDto("Rock"),
|
||||
new GenreDto("Jazz"),
|
||||
new GenreDto("Classical"),
|
||||
new GenreDto("Pop")
|
||||
_genreDtoFixture.Create(name: "Rock"),
|
||||
_genreDtoFixture.Create(name: "Jazz"),
|
||||
_genreDtoFixture.Create(name: "Classical"),
|
||||
_genreDtoFixture.Create(name: "Pop")
|
||||
];
|
||||
|
||||
// Act
|
||||
@@ -99,10 +102,10 @@ public class GenreDtoMappingTests
|
||||
// Arrange
|
||||
List<GenreDto> genreDtos =
|
||||
[
|
||||
new GenreDto("Rock"),
|
||||
new GenreDto(""),
|
||||
new GenreDto("Jazz"),
|
||||
new GenreDto(" ")
|
||||
_genreDtoFixture.Create(name: "Rock"),
|
||||
_genreDtoFixture.Create(name: ""),
|
||||
_genreDtoFixture.Create(name: "Jazz"),
|
||||
_genreDtoFixture.Create(name: " ")
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
+16
-13
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Application.Common.Mapping.Common.Metadata;
|
||||
using Lumina.Application.Fixtures.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Contracts.DTO.Common;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
@@ -18,11 +19,13 @@ namespace Lumina.Application.UnitTests.Common.Mapping.Common.Metadata;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class GenreEntityMappingTests
|
||||
{
|
||||
private readonly GenreEntityFixture _genreEntityFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToResponse_WhenMappingValidGenreEntity_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
GenreEntity entity = new("Fiction");
|
||||
GenreEntity entity = _genreEntityFixture.Create(name: "Fiction");
|
||||
|
||||
// Act
|
||||
GenreDto result = entity.ToResponse();
|
||||
@@ -40,7 +43,7 @@ public class GenreEntityMappingTests
|
||||
public void ToResponse_WhenMappingDifferentValidGenreEntities_ShouldMapCorrectly(string name)
|
||||
{
|
||||
// Arrange
|
||||
GenreEntity entity = new(name);
|
||||
GenreEntity entity = _genreEntityFixture.Create(name: name);
|
||||
|
||||
// Act
|
||||
GenreDto result = entity.ToResponse();
|
||||
@@ -57,7 +60,7 @@ public class GenreEntityMappingTests
|
||||
public void ToResponse_WhenMappingInvalidGenreEntity_ShouldMapToDefault(string? invalidName)
|
||||
{
|
||||
// Arrange
|
||||
GenreEntity entity = new(invalidName);
|
||||
GenreEntity entity = _genreEntityFixture.Create(name: invalidName, includeName: invalidName is not null);
|
||||
|
||||
// Act
|
||||
GenreDto result = entity.ToResponse();
|
||||
@@ -70,7 +73,7 @@ public class GenreEntityMappingTests
|
||||
public void ToDomainEntity_WhenMappingValidGenreEntity_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
GenreEntity entity = new("Fiction");
|
||||
GenreEntity entity = _genreEntityFixture.Create(name: "Fiction");
|
||||
|
||||
// Act
|
||||
Result<Genre> result = entity.ToDomainEntity();
|
||||
@@ -88,7 +91,7 @@ public class GenreEntityMappingTests
|
||||
public void ToDomainEntity_WhenMappingInvalidGenreEntity_ShouldMapToDefault(string? invalidName)
|
||||
{
|
||||
// Arrange
|
||||
GenreEntity entity = new(invalidName);
|
||||
GenreEntity entity = _genreEntityFixture.Create(name: invalidName, includeName: invalidName is not null);
|
||||
|
||||
// Act
|
||||
Result<Genre> result = entity.ToDomainEntity();
|
||||
@@ -104,10 +107,10 @@ public class GenreEntityMappingTests
|
||||
// Arrange
|
||||
List<GenreEntity> entities =
|
||||
[
|
||||
new GenreEntity("Fiction"),
|
||||
new GenreEntity("Mystery"),
|
||||
new GenreEntity("Romance"),
|
||||
new GenreEntity("Thriller")
|
||||
_genreEntityFixture.Create(name: "Fiction"),
|
||||
_genreEntityFixture.Create(name: "Mystery"),
|
||||
_genreEntityFixture.Create(name: "Romance"),
|
||||
_genreEntityFixture.Create(name: "Thriller")
|
||||
];
|
||||
|
||||
// Act
|
||||
@@ -131,10 +134,10 @@ public class GenreEntityMappingTests
|
||||
// Arrange
|
||||
List<GenreEntity> entities =
|
||||
[
|
||||
new GenreEntity("Fiction"),
|
||||
new GenreEntity("Mystery"),
|
||||
new GenreEntity("Romance"),
|
||||
new GenreEntity("Thriller")
|
||||
_genreEntityFixture.Create(name: "Fiction"),
|
||||
_genreEntityFixture.Create(name: "Mystery"),
|
||||
_genreEntityFixture.Create(name: "Romance"),
|
||||
_genreEntityFixture.Create(name: "Thriller")
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
+14
-11
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.Mapping.Common.Metadata;
|
||||
using Lumina.Contracts.DTO.Common;
|
||||
using Lumina.Contracts.Fixtures.Core.DTO.Common;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using System.Collections.Generic;
|
||||
@@ -16,11 +17,13 @@ namespace Lumina.Application.UnitTests.Common.Mapping.Common.Metadata;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class TagDtoMappingTests
|
||||
{
|
||||
private readonly TagDtoFixture _tagDtoFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToDomainEntity_WhenMappingValidTagDto_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
TagDto tagDto = new("indie");
|
||||
TagDto tagDto = _tagDtoFixture.Create(name: "indie");
|
||||
|
||||
// Act
|
||||
Result<Tag> result = tagDto.ToDomainEntity();
|
||||
@@ -40,7 +43,7 @@ public class TagDtoMappingTests
|
||||
public void ToDomainEntity_WhenMappingDifferentValidTagDtos_ShouldMapCorrectly(string name)
|
||||
{
|
||||
// Arrange
|
||||
TagDto tagDto = new(name);
|
||||
TagDto tagDto = _tagDtoFixture.Create(name: name);
|
||||
|
||||
// Act
|
||||
Result<Tag> result = tagDto.ToDomainEntity();
|
||||
@@ -58,7 +61,7 @@ public class TagDtoMappingTests
|
||||
public void ToDomainEntity_WhenMappingInvalidTagDto_ShouldReturnError(string? invalidName)
|
||||
{
|
||||
// Arrange
|
||||
TagDto tagDto = new(invalidName);
|
||||
TagDto tagDto = _tagDtoFixture.Create(name: invalidName, includeName: invalidName is not null);
|
||||
|
||||
// Act
|
||||
Result<Tag> result = tagDto.ToDomainEntity();
|
||||
@@ -73,10 +76,10 @@ public class TagDtoMappingTests
|
||||
// Arrange
|
||||
List<TagDto> tagDtos =
|
||||
[
|
||||
new TagDto("indie"),
|
||||
new TagDto("electronic"),
|
||||
new TagDto("instrumental"),
|
||||
new TagDto("live")
|
||||
_tagDtoFixture.Create(name: "indie"),
|
||||
_tagDtoFixture.Create(name: "electronic"),
|
||||
_tagDtoFixture.Create(name: "instrumental"),
|
||||
_tagDtoFixture.Create(name: "live")
|
||||
];
|
||||
|
||||
// Act
|
||||
@@ -100,10 +103,10 @@ public class TagDtoMappingTests
|
||||
// Arrange
|
||||
List<TagDto> tagDtos =
|
||||
[
|
||||
new TagDto("indie"),
|
||||
new TagDto(""),
|
||||
new TagDto("electronic"),
|
||||
new TagDto(" ")
|
||||
_tagDtoFixture.Create(name: "indie"),
|
||||
_tagDtoFixture.Create(name: ""),
|
||||
_tagDtoFixture.Create(name: "electronic"),
|
||||
_tagDtoFixture.Create(name: " ")
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
+16
-13
@@ -1,6 +1,7 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Application.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Application.Common.Mapping.Common.Metadata;
|
||||
using Lumina.Application.Fixtures.Common.DataAccess.Entities.Common;
|
||||
using Lumina.Contracts.DTO.Common;
|
||||
using Lumina.Domain.Common.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
@@ -18,11 +19,13 @@ namespace Lumina.Application.UnitTests.Common.Mapping.Common.Metadata;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class TagEntityMappingTests
|
||||
{
|
||||
private readonly TagEntityFixture _tagEntityFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ToResponse_WhenMappingValidTagEntity_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
TagEntity entity = new("Fantasy");
|
||||
TagEntity entity = _tagEntityFixture.Create(name: "Fantasy");
|
||||
|
||||
// Act
|
||||
TagDto result = entity.ToResponse();
|
||||
@@ -40,7 +43,7 @@ public class TagEntityMappingTests
|
||||
public void ToResponse_WhenMappingDifferentValidTagEntities_ShouldMapCorrectly(string name)
|
||||
{
|
||||
// Arrange
|
||||
TagEntity entity = new(name);
|
||||
TagEntity entity = _tagEntityFixture.Create(name: name);
|
||||
|
||||
// Act
|
||||
TagDto result = entity.ToResponse();
|
||||
@@ -57,7 +60,7 @@ public class TagEntityMappingTests
|
||||
public void ToResponse_WhenMappingInvalidTagEntity_ShouldMapToDefault(string? invalidName)
|
||||
{
|
||||
// Arrange
|
||||
TagEntity entity = new(invalidName);
|
||||
TagEntity entity = _tagEntityFixture.Create(name: invalidName, includeName: invalidName is not null);
|
||||
|
||||
// Act
|
||||
TagDto result = entity.ToResponse();
|
||||
@@ -70,7 +73,7 @@ public class TagEntityMappingTests
|
||||
public void ToDomainEntity_WhenMappingValidTagEntity_ShouldMapCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
TagEntity entity = new("Fantasy");
|
||||
TagEntity entity = _tagEntityFixture.Create(name: "Fantasy");
|
||||
|
||||
// Act
|
||||
Result<Tag> result = entity.ToDomainEntity();
|
||||
@@ -88,7 +91,7 @@ public class TagEntityMappingTests
|
||||
public void ToDomainEntity_WhenMappingInvalidTagEntity_ShouldMapToDefault(string? invalidName)
|
||||
{
|
||||
// Arrange
|
||||
TagEntity entity = new(invalidName);
|
||||
TagEntity entity = _tagEntityFixture.Create(name: invalidName, includeName: invalidName is not null);
|
||||
|
||||
// Act
|
||||
Result<Tag> result = entity.ToDomainEntity();
|
||||
@@ -104,10 +107,10 @@ public class TagEntityMappingTests
|
||||
// Arrange
|
||||
List<TagEntity> entities =
|
||||
[
|
||||
new TagEntity("Fantasy"),
|
||||
new TagEntity("Young Adult"),
|
||||
new TagEntity("Historical"),
|
||||
new TagEntity("Coming of Age")
|
||||
_tagEntityFixture.Create(name: "Fantasy"),
|
||||
_tagEntityFixture.Create(name: "Young Adult"),
|
||||
_tagEntityFixture.Create(name: "Historical"),
|
||||
_tagEntityFixture.Create(name: "Coming of Age")
|
||||
];
|
||||
|
||||
// Act
|
||||
@@ -131,10 +134,10 @@ public class TagEntityMappingTests
|
||||
// Arrange
|
||||
List<TagEntity> entities =
|
||||
[
|
||||
new TagEntity("Fantasy"),
|
||||
new TagEntity("Young Adult"),
|
||||
new TagEntity("Historical"),
|
||||
new TagEntity("Coming of Age")
|
||||
_tagEntityFixture.Create(name: "Fantasy"),
|
||||
_tagEntityFixture.Create(name: "Young Adult"),
|
||||
_tagEntityFixture.Create(name: "Historical"),
|
||||
_tagEntityFixture.Create(name: "Coming of Age")
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
Reference in new issue
Block a user