mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08:11:10 +00:00
Formats code comments as sentences in the tests.
Capitalizes the first word and adds the terminal period in the unit, integration and security tests. The AAA markers stay bare, the TODO bodies stay lowercase, and no assertion, payload, expected status code or test signature changes.
This commit is contained in:
1 parent
727aa33318
commit
057f557791
540 files changed
+3888
-3888
No files matched your search
+1
-1
@@ -68,7 +68,7 @@ public class UpdateArtistCommandMappingTests
|
||||
Album updatedAlbum = result.Value.Albums.First(album => album.Id.Value == albumId);
|
||||
Assert.Equal(albumCommand.Metadata!.Title, updatedAlbum.Metadata.Title);
|
||||
Track updatedTrack = updatedAlbum.Tracks.First(track => track.Id.Value == trackId);
|
||||
// the file system path of an existing track is never changed by the update, it is set only when the track is created
|
||||
// The file system path of an existing track is never changed by the update, it is set only when the track is created.
|
||||
Assert.Equal(originalPath, updatedTrack.Path);
|
||||
Assert.NotEqual(attemptedPath, updatedTrack.Path);
|
||||
Assert.Equal(7, updatedTrack.TrackNumber);
|
||||
|
||||
+2
-2
@@ -35,8 +35,8 @@ public class ArtistAliasEntityMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void ToDomainValueObject_WhenNameIsEmpty_ShouldReturnError(string name)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -50,9 +50,9 @@ public class IsrcDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing value
|
||||
[InlineData("")] // empty value
|
||||
[InlineData(" ")] // whitespace value
|
||||
[InlineData(null)] // Missing value.
|
||||
[InlineData("")] // Empty value.
|
||||
[InlineData(" ")] // Whitespace value.
|
||||
public void ToDomainValueObject_WhenValueIsNullOrWhitespace_ShouldReturnError(string? value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -67,11 +67,11 @@ public class IsrcDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("invalid")] // not an ISRC at all
|
||||
[InlineData("GBUM7102960")] // too short
|
||||
[InlineData("GBUM71029604X")] // too long
|
||||
[InlineData("1BUM71029604")] // country code is not two letters
|
||||
[InlineData("GBUM7102960A")] // designation code is not all digits
|
||||
[InlineData("invalid")] // Not an ISRC at all.
|
||||
[InlineData("GBUM7102960")] // Too short.
|
||||
[InlineData("GBUM71029604X")] // Too long.
|
||||
[InlineData("1BUM71029604")] // Country code is not two letters.
|
||||
[InlineData("GBUM7102960A")] // Designation code is not all digits.
|
||||
public void ToDomainValueObject_WhenValueIsMalformed_ShouldReturnError(string value)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ public class IsrcEntityMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty value
|
||||
[InlineData(" ")] // whitespace value
|
||||
[InlineData("")] // Empty value.
|
||||
[InlineData(" ")] // Whitespace value.
|
||||
public void ToDomainValueObject_WhenValueIsWhitespace_ShouldReturnError(string value)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -36,9 +36,9 @@ public class MoodDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing name
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData(null)] // Missing name.
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void ToDomainValueObject_WhenNameIsNullOrWhitespace_ShouldReturnError(string? name)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ public class MoodEntityMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void ToDomainValueObject_WhenNameIsWhitespace_ShouldReturnError(string name)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -65,9 +65,9 @@ public class MusicAreaDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing name
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData(null)] // Missing name.
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void ToDomainValueObject_WhenNameIsNullOrWhitespace_ShouldReturnError(string? name)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -36,8 +36,8 @@ public class MusicAreaEntityMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void ToDomainValueObject_WhenNameIsEmpty_ShouldReturnError(string name)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -35,9 +35,9 @@ public class MusicArtistAliasDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing name
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData(null)] // Missing name.
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void ToDomainValueObject_WhenNameIsNullOrWhitespace_ShouldReturnError(string? name)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -92,8 +92,8 @@ public class MusicWorkDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty work title
|
||||
[InlineData(" ")] // whitespace work title
|
||||
[InlineData("")] // Empty work title.
|
||||
[InlineData(" ")] // Whitespace work title.
|
||||
public void ToDomainEntity_WhenTitleIsEmptyOrWhitespace_ShouldReturnError(string title)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -88,9 +88,9 @@ public class ShuffleTracksRequestMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("not-a-guid")] // a value that cannot be parsed
|
||||
[InlineData("' OR '1'='1")] // an injection payload
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // a destructive injection payload
|
||||
[InlineData("not-a-guid")] // A value that cannot be parsed.
|
||||
[InlineData("' OR '1'='1")] // An injection payload.
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // A destructive injection payload.
|
||||
public void ToQuery_WhenLibraryIdArgumentIsNotParseable_ShouldPassItVerbatim(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class UpdateTrackCommandMappingTests
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Track updatedTrack = result.Value.Albums.First(album => album.Id.Value == albumId).Tracks.First(track => track.Id.Value == trackId);
|
||||
// the file system path is never changed by the update, it is set only when the track is created
|
||||
// The file system path is never changed by the update, it is set only when the track is created.
|
||||
Assert.Equal(originalPath, updatedTrack.Path);
|
||||
Assert.Equal(command.TrackNumber, updatedTrack.TrackNumber);
|
||||
Assert.False(updatedTrack.DiscNumber.HasValue);
|
||||
|
||||
+3
-3
@@ -30,9 +30,9 @@ public class GetLibraryPathTemplatePartsRequestMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Book")] // a written content library type
|
||||
[InlineData("Movie")] // a video library type
|
||||
[InlineData("Music")] // an audio library type
|
||||
[InlineData("Book")] // A written content library type.
|
||||
[InlineData("Movie")] // A video library type.
|
||||
[InlineData("Music")] // An audio library type.
|
||||
public void ToQuery_WhenMappingDifferentLibraryTypes_ShouldMapLibraryType(string libraryType)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@ public class BookMappingTests
|
||||
entity.ApplyMetadataToEntity(book);
|
||||
|
||||
// Assert
|
||||
// the identity and the collection columns are not part of the metadata application
|
||||
// The identity and the collection columns are not part of the metadata application.
|
||||
Assert.Equal(entityId, entity.Id);
|
||||
Assert.Equal(libraryId, entity.LibraryId);
|
||||
Assert.Equal(path, entity.Path);
|
||||
|
||||
+3
-3
@@ -73,9 +73,9 @@ public class BookMetadataDtoMappingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing title
|
||||
[InlineData("")] // empty title
|
||||
[InlineData(" ")] // whitespace title
|
||||
[InlineData(null)] // Missing title.
|
||||
[InlineData("")] // Empty title.
|
||||
[InlineData(" ")] // Whitespace title.
|
||||
public void ApplyMetadata_WhenTitleIsNullOrWhitespace_ShouldReturnTitleCannotBeEmptyError(string? title)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -104,13 +104,13 @@ public class BookRatingDtoMappingTests
|
||||
foreach (Result<BookRating> result in resultList)
|
||||
Assert.False(result.IsFailure);
|
||||
|
||||
// complete rating
|
||||
// Complete rating.
|
||||
Assert.Equal(dtos[0].Value!.Value, resultList[0].Value.Value);
|
||||
Assert.Equal(dtos[0].MaxValue!.Value, resultList[0].Value.MaxValue);
|
||||
Assert.Equal(dtos[0].Source!.Value, resultList[0].Value.Source.Value);
|
||||
Assert.Equal(dtos[0].VoteCount!.Value, resultList[0].Value.VoteCount.Value);
|
||||
|
||||
// minimal rating
|
||||
// Minimal rating.
|
||||
Assert.Equal(dtos[1].Value!.Value, resultList[1].Value.Value);
|
||||
Assert.Equal(dtos[1].MaxValue!.Value, resultList[1].Value.MaxValue);
|
||||
Assert.False(resultList[1].Value.Source.HasValue);
|
||||
|
||||
+3
-3
@@ -92,19 +92,19 @@ public class BookRatingMappingTests
|
||||
|
||||
List<BookRatingEntity> resultList = [.. results];
|
||||
|
||||
// complete rating
|
||||
// Complete rating.
|
||||
Assert.Equal(bookRatings[0].Value, resultList[0].Value);
|
||||
Assert.Equal(bookRatings[0].MaxValue, resultList[0].MaxValue);
|
||||
Assert.Equal(bookRatings[0].Source.Value, resultList[0].Source);
|
||||
Assert.Equal(bookRatings[0].VoteCount.Value, resultList[0].VoteCount);
|
||||
|
||||
// rating without source
|
||||
// Rating without source.
|
||||
Assert.Equal(bookRatings[1].Value, resultList[1].Value);
|
||||
Assert.Equal(bookRatings[1].MaxValue, resultList[1].MaxValue);
|
||||
Assert.Null(resultList[1].Source);
|
||||
Assert.Equal(bookRatings[1].VoteCount.Value, resultList[1].VoteCount);
|
||||
|
||||
// rating without vote count
|
||||
// Rating without vote count.
|
||||
Assert.Equal(bookRatings[2].Value, resultList[2].Value);
|
||||
Assert.Equal(bookRatings[2].MaxValue, resultList[2].MaxValue);
|
||||
Assert.Equal(bookRatings[2].Source.Value, resultList[2].Source);
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ public class IsbnDtoMappingTests
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.NotNull(result.Value);
|
||||
Assert.Equal(dto.Value, result.Value.Value);
|
||||
Assert.Equal(IsbnFormat.Isbn13, result.Value.Format); // default format
|
||||
Assert.Equal(IsbnFormat.Isbn13, result.Value.Format); // Default format.
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -110,7 +110,7 @@ public class IsbnDtoMappingTests
|
||||
Assert.Equal(dtos[1].Format!.Value, resultList[1].Value.Format);
|
||||
|
||||
Assert.Equal(dtos[2].Value, resultList[2].Value.Value);
|
||||
Assert.Equal(IsbnFormat.Isbn13, resultList[2].Value.Format); // default format
|
||||
Assert.Equal(IsbnFormat.Isbn13, resultList[2].Value.Format); // Default format.
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in new issue
Block a user