mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15: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
+9
-9
@@ -83,8 +83,8 @@ public class GetPlaybackManifestEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true)] // a null template means the delivery has no segment route
|
||||
[InlineData(false)] // an empty template means the delivery has no segment route
|
||||
[InlineData(true)] // A null template means the delivery has no segment route.
|
||||
[InlineData(false)] // An empty template means the delivery has no segment route.
|
||||
public async Task ExecuteAsync_WhenSegmentPathTemplateIsEmpty_ShouldClearTheDeliveryIdAndTheTemplate(bool useNullTemplate)
|
||||
{
|
||||
// Arrange
|
||||
@@ -153,10 +153,10 @@ public class GetPlaybackManifestEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("mp3/mp3", "?capabilities=mp3%2Fmp3")] // the capabilities are forwarded and URL-escaped
|
||||
[InlineData("flac/flac,mp3/mp3", "?capabilities=flac%2Fflac%2Cmp3%2Fmp3")] // a capability list is forwarded as one escaped value
|
||||
[InlineData(" ", "")] // whitespace only capabilities are not forwarded
|
||||
[InlineData(null, "")] // absent capabilities are not forwarded
|
||||
[InlineData("mp3/mp3", "?capabilities=mp3%2Fmp3")] // The capabilities are forwarded and URL-escaped.
|
||||
[InlineData("flac/flac,mp3/mp3", "?capabilities=flac%2Fflac%2Cmp3%2Fmp3")] // A capability list is forwarded as one escaped value.
|
||||
[InlineData(" ", "")] // Whitespace only capabilities are not forwarded.
|
||||
[InlineData(null, "")] // Absent capabilities are not forwarded.
|
||||
public async Task ExecuteAsync_WhenCapabilitiesAreProvided_ShouldForwardThemOnlyWhenTheyAreNotEmpty(string? capabilities, string expectedSuffix)
|
||||
{
|
||||
// Arrange
|
||||
@@ -211,9 +211,9 @@ public class GetPlaybackManifestEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("/lumina", "/lumina")] // a plain absolute path base is prefixed
|
||||
[InlineData("//evil", "")] // a protocol relative path base would point the stream at another origin
|
||||
[InlineData("/a?b", "")] // a path base with a query would truncate the built path
|
||||
[InlineData("/lumina", "/lumina")] // A plain absolute path base is prefixed.
|
||||
[InlineData("//evil", "")] // A protocol relative path base would point the stream at another origin.
|
||||
[InlineData("/a?b", "")] // A path base with a query would truncate the built path.
|
||||
public async Task ExecuteAsync_WhenPathBaseIsPresent_ShouldUseItOnlyWhenItIsSafe(string pathBase, string expectedPrefix)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -142,8 +142,8 @@ public class StreamMusicTrackEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HttpStatusCode.ServiceUnavailable)] // a busy normalization pipeline is a transient condition
|
||||
[InlineData(HttpStatusCode.TooManyRequests)] // the stream concurrency limit was reached
|
||||
[InlineData(HttpStatusCode.ServiceUnavailable)] // A busy normalization pipeline is a transient condition.
|
||||
[InlineData(HttpStatusCode.TooManyRequests)] // The stream concurrency limit was reached.
|
||||
public async Task ExecuteAsync_WhenApiReportsATransientCondition_ShouldReturnABareStatusWithoutThrowing(HttpStatusCode statusCode)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -46,9 +46,9 @@ public class StreamMusicTrackSegmentEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("uppercase")] // the handle format only accepts lowercase hexadecimal characters
|
||||
[InlineData("dashed")] // the handle format is the N format of a GUID, without dashes
|
||||
[InlineData("short")] // a handle that is shorter than the format allows
|
||||
[InlineData("uppercase")] // The handle format only accepts lowercase hexadecimal characters.
|
||||
[InlineData("dashed")] // The handle format is the N format of a GUID, without dashes.
|
||||
[InlineData("short")] // A handle that is shorter than the format allows.
|
||||
public async Task ExecuteAsync_WhenDeliveryIdIsInvalid_ShouldReturnNotFoundWithoutCallingTheApi(string malformedHandleKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -104,9 +104,9 @@ public class StreamMusicTrackSegmentEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("artistId", "' OR '1'='1")] // an unparseable artist Id is normalized to an empty GUID
|
||||
[InlineData("albumId", "'; DROP TABLE Tracks; --")] // an unparseable album Id is normalized to an empty GUID
|
||||
[InlineData("trackId", "not-a-guid")] // an unparseable track Id is normalized to an empty GUID
|
||||
[InlineData("artistId", "' OR '1'='1")] // An unparseable artist Id is normalized to an empty GUID.
|
||||
[InlineData("albumId", "'; DROP TABLE Tracks; --")] // An unparseable album Id is normalized to an empty GUID.
|
||||
[InlineData("trackId", "not-a-guid")] // An unparseable track Id is normalized to an empty GUID.
|
||||
public async Task ExecuteAsync_WhenRouteIdsAreNotParseable_ShouldForwardEmptyGuidsToTheApi(string routeValue, string invalidValue)
|
||||
{
|
||||
// Arrange
|
||||
@@ -137,8 +137,8 @@ public class StreamMusicTrackSegmentEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HttpStatusCode.ServiceUnavailable)] // a busy normalization pipeline is a transient condition
|
||||
[InlineData(HttpStatusCode.TooManyRequests)] // the stream concurrency limit was reached
|
||||
[InlineData(HttpStatusCode.ServiceUnavailable)] // A busy normalization pipeline is a transient condition.
|
||||
[InlineData(HttpStatusCode.TooManyRequests)] // The stream concurrency limit was reached.
|
||||
public async Task ExecuteAsync_WhenApiReportsATransientCondition_ShouldReturnABareStatusWithoutThrowing(HttpStatusCode statusCode)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -53,9 +53,9 @@ public class ClearConsumptionHistoryEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespace_ShouldDeleteCurrentUserHistory(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -53,9 +53,9 @@ public class ClearResumePointsEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespaceAndLibraryIdIsNull_ShouldClearCurrentUserResumePointsWithoutFilter(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -58,9 +58,9 @@ public class DeleteConsumptionItemHistoryEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespace_ShouldDeleteCurrentUserItemHistory(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -81,9 +81,9 @@ public class DeleteConsumptionItemHistoryEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(MediaKind.MusicTrack, "MusicTrack")] // a music track
|
||||
[InlineData(MediaKind.PodcastEpisode, "PodcastEpisode")] // a podcast episode
|
||||
[InlineData(MediaKind.Book, "Book")] // a book
|
||||
[InlineData(MediaKind.MusicTrack, "MusicTrack")] // A music track.
|
||||
[InlineData(MediaKind.PodcastEpisode, "PodcastEpisode")] // A podcast episode.
|
||||
[InlineData(MediaKind.Book, "Book")] // A book.
|
||||
public async Task ExecuteAsync_WhenMediaKindIsSet_ShouldUseTheMediaKindNameInTheUpstreamRoute(MediaKind mediaKind, string expectedMediaKind)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -68,9 +68,9 @@ public class GetConsumptionStatisticsEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespace_ShouldRequestCurrentUserStatisticsWithoutQueryString(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -69,9 +69,9 @@ public class GetGenreConsumptionEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespace_ShouldRequestCurrentUserGenresWithoutQueryString(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -80,9 +80,9 @@ public class GetMostConsumedEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespaceAndNoFilterIsSupplied_ShouldRequestCurrentUserItemsWithDefaultPaging(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -80,9 +80,9 @@ public class GetRecentlyConsumedEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespaceAndNoFilterIsSupplied_ShouldRequestCurrentUserItemsWithDefaultPaging(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -69,9 +69,9 @@ public class GetTagConsumptionEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no user selected, the current user is implied
|
||||
[InlineData("")] // empty user selected
|
||||
[InlineData(" ")] // whitespace user selected
|
||||
[InlineData(null)] // No user selected, the current user is implied.
|
||||
[InlineData("")] // Empty user selected.
|
||||
[InlineData(" ")] // Whitespace user selected.
|
||||
public async Task ExecuteAsync_WhenUserIdIsNullOrWhitespace_ShouldRequestCurrentUserTagsWithoutQueryString(string? userId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -190,9 +190,9 @@ public class StatisticsIndexViewEndpointTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no identifier claim at all
|
||||
[InlineData("")] // empty identifier claim
|
||||
[InlineData("not-a-guid")] // identifier claim that is not a GUID
|
||||
[InlineData(null)] // No identifier claim at all.
|
||||
[InlineData("")] // Empty identifier claim.
|
||||
[InlineData("not-a-guid")] // Identifier claim that is not a GUID.
|
||||
public async Task ExecuteAsync_WhenNameIdentifierIsMissingOrNotAGuid_ShouldLeaveCurrentUserIdNull(string? nameIdentifier)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in new issue
Block a user