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:
BinaryAlley committed 2026-11-16 18:17:29 +02:00
1 parent 727aa33318
commit 057f557791
540 files changed
+3888 -3888

No files matched your search

@@ -123,7 +123,7 @@ public class HandlersCallTheirValidatorsTests
int offset = 0;
while (offset < il.Length)
{
// read the opcode, handling the 0xFE prefix used by two-byte opcodes
// Read the opcode, handling the 0xFE prefix used by two-byte opcodes.
short opCodeValue = il[offset];
int opCodeSize = 1;
if (opCodeValue == 0xFE && offset + 1 < il.Length)
@@ -152,15 +152,15 @@ public class HandlersCallTheirValidatorsTests
}
catch (ArgumentException)
{
// the token is not a valid method token, skip it
// The token is not a valid method token, skip it.
}
catch (BadImageFormatException)
{
// the token references corrupt metadata, skip it
// The token references corrupt metadata, skip it.
}
catch (InvalidOperationException)
{
// the token cannot be resolved as a method, skip it
// The token cannot be resolved as a method, skip it.
}
}
@@ -21,8 +21,8 @@ public class DirectoryMappingTests
private readonly DirectoryFixture _directoryFixture = new();
[Theory]
[InlineData(true)] // hidden directory
[InlineData(false)] // visible directory
[InlineData(true)] // Hidden directory.
[InlineData(false)] // Visible directory.
public void ToFileSystemTreeNodeResponse_WhenMappingDirectory_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -86,8 +86,8 @@ public class DirectoryMappingTests
}
[Theory]
[InlineData(true)] // hidden directory
[InlineData(false)] // visible directory
[InlineData(true)] // Hidden directory.
[InlineData(false)] // Visible directory.
public void ToResponse_WhenMappingDirectory_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -30,8 +30,8 @@ public class FileSystemItemMappingTests
private readonly UnixRootItemFixture _unixRootItemFixture = new();
[Theory]
[InlineData(true)] // hidden file system item
[InlineData(false)] // visible file system item
[InlineData(true)] // Hidden file system item.
[InlineData(false)] // Visible file system item.
public void ToFileSystemItemModel_WhenMappingFileSystemItem_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -54,8 +54,8 @@ public class FileSystemItemMappingTests
}
[Theory]
[InlineData(true)] // hidden directory
[InlineData(false)] // visible directory
[InlineData(true)] // Hidden directory.
[InlineData(false)] // Visible directory.
public void ToTreeNodeResponse_WhenMappingDirectory_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -73,8 +73,8 @@ public class FileSystemItemMappingTests
}
[Theory]
[InlineData(true)] // hidden file
[InlineData(false)] // visible file
[InlineData(true)] // Hidden file.
[InlineData(false)] // Visible file.
public void ToTreeNodeResponse_WhenMappingFile_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -132,8 +132,8 @@ public class FileSystemItemMappingTests
}
[Theory]
[InlineData("TestFile.txt", FileSystemItemType.File, true)] // hidden file
[InlineData("TestFolder", FileSystemItemType.Directory, false)] // visible directory
[InlineData("TestFile.txt", FileSystemItemType.File, true)] // Hidden file.
[InlineData("TestFolder", FileSystemItemType.Directory, false)] // Visible directory.
public void ToFileSystemItemModel_WhenMappingDifferentFileSystemItems_ShouldMapCorrectly(string name, FileSystemItemType type, bool isHidden)
{
// Arrange
@@ -21,8 +21,8 @@ public class FileMappingTests
private readonly FileFixture _fileFixture = new();
[Theory]
[InlineData(true)] // hidden file
[InlineData(false)] // visible file
[InlineData(true)] // Hidden file.
[InlineData(false)] // Visible file.
public void ToFileSystemTreeNodeResponse_WhenMappingFile_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -73,8 +73,8 @@ public class FileMappingTests
}
[Theory]
[InlineData(true)] // hidden file
[InlineData(false)] // visible file
[InlineData(true)] // Hidden file.
[InlineData(false)] // Visible file.
public void ToResponse_WhenMappingFile_ShouldMapCorrectly(bool isHidden)
{
// Arrange
@@ -140,10 +140,10 @@ public class GetMostConsumedRequestMappingTests
}
[Theory]
[InlineData(0, 0, 1, 1)] // both at the lower boundary
[InlineData(0, -5, 1, 1)] // zero current page with a negative page size
[InlineData(-3, 10, 1, 10)] // negative current page with a valid page size
[InlineData(-2, -7, 1, 1)] // both negative
[InlineData(0, 0, 1, 1)] // Both at the lower boundary.
[InlineData(0, -5, 1, 1)] // Zero current page with a negative page size.
[InlineData(-3, 10, 1, 10)] // Negative current page with a valid page size.
[InlineData(-2, -7, 1, 1)] // Both negative.
public void ToQuery_WhenCurrentPageOrPerPageIsNotPositive_ShouldClampOnlyTheInvalidValue(
int currentPage,
int perPage,
@@ -140,10 +140,10 @@ public class GetRecentlyConsumedRequestMappingTests
}
[Theory]
[InlineData(0, 0, 1, 1)] // both at the lower boundary
[InlineData(0, -5, 1, 1)] // zero current page with a negative page size
[InlineData(-3, 10, 1, 10)] // negative current page with a valid page size
[InlineData(-2, -7, 1, 1)] // both negative
[InlineData(0, 0, 1, 1)] // Both at the lower boundary.
[InlineData(0, -5, 1, 1)] // Zero current page with a negative page size.
[InlineData(-3, 10, 1, 10)] // Negative current page with a valid page size.
[InlineData(-2, -7, 1, 1)] // Both negative.
public void ToQuery_WhenCurrentPageOrPerPageIsNotPositive_ShouldClampOnlyTheInvalidValue(
int currentPage,
int perPage,
@@ -351,8 +351,8 @@ public class MediaConsumptionRecordEntityMappingTests
}
[Theory]
[InlineData("")] // an empty location is not a usable position
[InlineData(" ")] // a whitespace only location is not a usable position
[InlineData("")] // An empty location is not a usable position.
[InlineData(" ")] // A whitespace only location is not a usable position.
public void ToDomainEntity_WhenLocationPositionHasABlankLocation_ShouldReturnInvalidMediaPosition(string location)
{
// Arrange
@@ -43,8 +43,8 @@ public class MediaKindConsumptionStatisticsDtoMappingTests
}
[Theory]
[InlineData(1_500, 1.5)] // half a second survives the conversion
[InlineData(2_000, 2)] // a whole number of seconds stays whole
[InlineData(1_500, 1.5)] // Half a second survives the conversion.
[InlineData(2_000, 2)] // A whole number of seconds stays whole.
public void ToResponse_WhenDurationIsInMilliseconds_ShouldConvertToSeconds(long consumedDurationMilliseconds, double expectedSeconds)
{
// Arrange
@@ -276,8 +276,8 @@ public class MediaResumePointEntityMappingTests
}
[Theory]
[InlineData("")] // an empty location is not a usable position
[InlineData(" ")] // a whitespace only location is not a usable position
[InlineData("")] // An empty location is not a usable position.
[InlineData(" ")] // A whitespace only location is not a usable position.
public void ToDomainEntity_WhenLocationPositionHasABlankLocation_ShouldReturnInvalidMediaPosition(string location)
{
// Arrange
@@ -329,8 +329,8 @@ public class MediaResumePointEntityMappingTests
}
[Theory]
[InlineData(MediaKind.MusicTrack, MediaPositionKind.Location, "chapter-1")] // music tracks are resumed from a time offset
[InlineData(MediaKind.Book, MediaPositionKind.TimeOffset, null)] // books are resumed from a location
[InlineData(MediaKind.MusicTrack, MediaPositionKind.Location, "chapter-1")] // Music tracks are resumed from a time offset.
[InlineData(MediaKind.Book, MediaPositionKind.TimeOffset, null)] // Books are resumed from a location.
public void ToDomainEntity_WhenPositionKindDoesNotMatchTheMediaKindRule_ShouldReturnInvalidMediaPosition(MediaKind mediaKind, MediaPositionKind positionKind, string? location)
{
// Arrange
@@ -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);
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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);
@@ -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
@@ -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);
@@ -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
@@ -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);
@@ -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);
@@ -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]
@@ -38,10 +38,10 @@ public class UserMappingTests
// Assert
Assert.NotNull(result);
Assert.Same(repositoryEntity, result); // should modify the same instance
Assert.Equal(domainEntity.Username, result.Username); // only username should be updated
Assert.Same(repositoryEntity, result); // Should modify the same instance.
Assert.Equal(domainEntity.Username, result.Username); // Only username should be updated.
// verify other properties remain unchanged
// Verify other properties remain unchanged.
Assert.Equal(repositoryEntity.Id, result.Id);
Assert.Equal(repositoryEntity.Password, result.Password);
Assert.Equal(repositoryEntity.TotpSecret, result.TotpSecret);
@@ -47,8 +47,8 @@ public class UpdatePlaybackStateRequestMappingTests
}
[Theory]
[InlineData(0.0, false)] // the minimum volume, not muted
[InlineData(1.0, true)] // the maximum volume, muted
[InlineData(0.0, false)] // The minimum volume, not muted.
[InlineData(1.0, true)] // The maximum volume, muted.
public void ToCommand_WhenMappingBoundaryValues_ShouldMapThemExactly(double volume, bool isMuted)
{
// Arrange
@@ -49,7 +49,7 @@ internal static class TelemetryTestHelpers
};
// InstrumentPublished fires for instruments created after Start(), and Start() also replays every instrument
// that already exists on the meter; therefore the lazily-initialized static handler instruments are captured by
// every listener, whether they were created before or during the test
// every listener, whether they were created before or during the test.
listener.SetMeasurementEventCallback<double>((instrument, value, tags, state) => measurements.Add((instrument.Name, value, GetOutcomeTag(tags))));
listener.SetMeasurementEventCallback<long>((instrument, value, tags, state) => measurements.Add((instrument.Name, value, GetOutcomeTag(tags))));
listener.Start();
@@ -13,21 +13,21 @@ namespace Lumina.Application.UnitTests.Common.Utilities;
public class AudioFileFormatUtilitiesTests
{
[Theory]
[InlineData("track.mp3", AudioFileFormat.MP3)] // mp3 audio file
[InlineData("track.flac", AudioFileFormat.FLAC)] // flac audio file
[InlineData("track.m4a", AudioFileFormat.M4A)] // m4a audio file
[InlineData("track.aac", AudioFileFormat.AAC)] // aac audio file
[InlineData("track.ogg", AudioFileFormat.OGG)] // ogg audio file
[InlineData("track.opus", AudioFileFormat.OPUS)] // opus audio file
[InlineData("track.wav", AudioFileFormat.WAV)] // wav audio file
[InlineData("track.wma", AudioFileFormat.WMA)] // wma audio file
[InlineData("track.aiff", AudioFileFormat.AIFF)] // aiff audio file
[InlineData("track.aif", AudioFileFormat.AIFF)] // aif audio file
[InlineData("track.ape", AudioFileFormat.APE)] // ape audio file
[InlineData("track.wv", AudioFileFormat.WAVPACK)] // wavpack audio file
[InlineData("track.dsf", AudioFileFormat.DSF)] // dsf audio file
[InlineData("track.dff", AudioFileFormat.DFF)] // dff audio file
[InlineData("track.mka", AudioFileFormat.MATROSKA)] // matroska audio file
[InlineData("track.mp3", AudioFileFormat.MP3)] // MP3 audio file.
[InlineData("track.flac", AudioFileFormat.FLAC)] // FLAC audio file.
[InlineData("track.m4a", AudioFileFormat.M4A)] // M4A audio file.
[InlineData("track.aac", AudioFileFormat.AAC)] // AAC audio file.
[InlineData("track.ogg", AudioFileFormat.OGG)] // OGG audio file.
[InlineData("track.opus", AudioFileFormat.OPUS)] // Opus audio file.
[InlineData("track.wav", AudioFileFormat.WAV)] // WAV audio file.
[InlineData("track.wma", AudioFileFormat.WMA)] // WMA audio file.
[InlineData("track.aiff", AudioFileFormat.AIFF)] // AIFF audio file.
[InlineData("track.aif", AudioFileFormat.AIFF)] // AIF audio file.
[InlineData("track.ape", AudioFileFormat.APE)] // APE audio file.
[InlineData("track.wv", AudioFileFormat.WAVPACK)] // WavPack audio file.
[InlineData("track.dsf", AudioFileFormat.DSF)] // DSF audio file.
[InlineData("track.dff", AudioFileFormat.DFF)] // DFF audio file.
[InlineData("track.mka", AudioFileFormat.MATROSKA)] // Matroska audio file.
public void ToAudioFileFormat_WhenExtensionIsKnown_ShouldReturnMappedFormat(string filePath, AudioFileFormat expectedFormat)
{
// Act
@@ -23,9 +23,9 @@ public class DurationUtilitiesTests
}
[Theory]
[InlineData(1, 0.001)] // a single millisecond is preserved
[InlineData(1_500, 1.5)] // whole milliseconds convert to fractional seconds
[InlineData(60_000, 60)] // a full minute converts exactly
[InlineData(1, 0.001)] // A single millisecond is preserved.
[InlineData(1_500, 1.5)] // Whole milliseconds convert to fractional seconds.
[InlineData(60_000, 60)] // A full minute converts exactly.
public void ToClampedTimeSpan_WhenMillisecondsIsWithinTheRepresentableRange_ShouldConvertToTheEquivalentSeconds(long milliseconds, double expectedTotalSeconds)
{
// Act
@@ -36,8 +36,8 @@ public class DurationUtilitiesTests
}
[Theory]
[InlineData(-1)] // a single negative millisecond
[InlineData(-1_500)] // negative fractional seconds
[InlineData(-1)] // A single negative millisecond.
[InlineData(-1_500)] // Negative fractional seconds.
public void ToClampedTimeSpan_WhenMillisecondsIsNegative_ShouldReturnTheEquivalentNegativeDuration(long milliseconds)
{
// Act
@@ -15,10 +15,10 @@ namespace Lumina.Application.UnitTests.Common.Utilities;
public class FavoriteMediaKindExtensionsTests
{
[Theory]
[InlineData(FavoriteMediaKind.MusicArtist, nameof(DomainErrors.Music.ArtistNotFound))] // an artist has no library of its own
[InlineData(FavoriteMediaKind.MusicAlbum, nameof(DomainErrors.Music.AlbumNotFound))] // an album is not a media item that can be favorited
[InlineData(FavoriteMediaKind.MusicTrack, nameof(DomainErrors.Music.TrackNotFound))] // a track is resolved through the music catalogue
[InlineData(FavoriteMediaKind.Book, nameof(DomainErrors.WrittenContent.BookNotFound))] // a book is resolved through the written content catalogue
[InlineData(FavoriteMediaKind.MusicArtist, nameof(DomainErrors.Music.ArtistNotFound))] // An artist has no library of its own.
[InlineData(FavoriteMediaKind.MusicAlbum, nameof(DomainErrors.Music.AlbumNotFound))] // An album is not a media item that can be favorited.
[InlineData(FavoriteMediaKind.MusicTrack, nameof(DomainErrors.Music.TrackNotFound))] // A track is resolved through the music catalogue.
[InlineData(FavoriteMediaKind.Book, nameof(DomainErrors.WrittenContent.BookNotFound))] // A book is resolved through the written content catalogue.
public void ToMediaItemNotFoundError_WhenTheMediaKindIsCatalogued_ShouldReturnTheMediaSpecificNotFoundError(FavoriteMediaKind mediaKind, string expectedDescription)
{
// Act
@@ -29,9 +29,9 @@ public class FavoriteMediaKindExtensionsTests
}
[Theory]
[InlineData(FavoriteMediaKind.None)] // the default value, which is not a kind that can be favorited
[InlineData(FavoriteMediaKind.Video)] // video libraries are not catalogued yet
[InlineData(FavoriteMediaKind.Photo)] // photo libraries are not catalogued yet
[InlineData(FavoriteMediaKind.None)] // The default value, which is not a kind that can be favorited.
[InlineData(FavoriteMediaKind.Video)] // Video libraries are not catalogued yet.
[InlineData(FavoriteMediaKind.Photo)] // Photo libraries are not catalogued yet.
public void ToMediaItemNotFoundError_WhenTheMediaKindIsNotCatalogued_ShouldReturnTheNotSupportedError(FavoriteMediaKind mediaKind)
{
// Act
@@ -34,8 +34,8 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData(4)] // value is greater than the comparison value
[InlineData(100)] // value is much greater than the comparison value
[InlineData(4)] // Value is greater than the comparison value.
[InlineData(100)] // Value is much greater than the comparison value.
public void Validate_WhenIntValueIsGreaterThanComparison_ShouldNotHaveValidationError(int value)
{
// Arrange
@@ -50,9 +50,9 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData(3)] // value equals the comparison value
[InlineData(1)] // value is smaller than the comparison value
[InlineData(-5)] // value is negative and smaller than the comparison value
[InlineData(3)] // Value equals the comparison value.
[InlineData(1)] // Value is smaller than the comparison value.
[InlineData(-5)] // Value is negative and smaller than the comparison value.
public void Validate_WhenIntValueIsNotGreaterThanComparison_ShouldHaveValidationError(int value)
{
// Arrange
@@ -262,9 +262,9 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData(null)] // null string
[InlineData("")] // empty string
[InlineData(" ")] // white-space only string
[InlineData(null)] // Null string.
[InlineData("")] // Empty string.
[InlineData(" ")] // White-space only string.
public void Validate_WhenNotEmptyValueIsEmpty_ShouldHaveValidationError(string? value)
{
// Arrange
@@ -432,9 +432,9 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData(nameof(ValidatorUtilitiesTestEnum.First))] // the exact member name
[InlineData("first")] // the member name in lower case
[InlineData("SECOND")] // the member name in upper case
[InlineData(nameof(ValidatorUtilitiesTestEnum.First))] // The exact member name.
[InlineData("first")] // The member name in lower case.
[InlineData("SECOND")] // The member name in upper case.
public void Validate_WhenTextualEnumValueIsAMemberName_ShouldNotHaveValidationError(string textualEnumValue)
{
// Arrange
@@ -448,12 +448,12 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData("")] // an empty value
[InlineData(" ")] // a whitespace only value
[InlineData("Unknown")] // a name that is not a member of the enumeration
[InlineData("0")] // a number that is a defined member value, which must still be rejected
[InlineData("1")] // another number that is a defined member value
[InlineData("99")] // a number that is not a member value
[InlineData("")] // An empty value.
[InlineData(" ")] // A whitespace only value.
[InlineData("Unknown")] // A name that is not a member of the enumeration.
[InlineData("0")] // A number that is a defined member value, which must still be rejected.
[InlineData("1")] // Another number that is a defined member value.
[InlineData("99")] // A number that is not a member value.
public void Validate_WhenTextualEnumValueIsNotAMemberName_ShouldHaveValidationError(string textualEnumValue)
{
// Arrange
@@ -886,8 +886,8 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData(0.99)] // just below the minimum
[InlineData(10.01)] // just above the maximum
[InlineData(0.99)] // Just below the minimum.
[InlineData(10.01)] // Just above the maximum.
public void Validate_WhenInclusiveNullableDoubleValueIsOutsideRange_ShouldHaveValidationError(double inclusiveNullableDoubleValue)
{
// Arrange
@@ -902,9 +902,9 @@ public class ValidatorUtilitiesTests
}
[Theory]
[InlineData(1.0)] // the minimum
[InlineData(5.0)] // a middle value
[InlineData(10.0)] // the maximum
[InlineData(1.0)] // The minimum.
[InlineData(5.0)] // A middle value.
[InlineData(10.0)] // The maximum.
public void Validate_WhenInclusiveNullableDoubleValueIsWithinRange_ShouldNotHaveValidationError(double inclusiveNullableDoubleValue)
{
// Arrange