mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14: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
+17
-17
@@ -53,9 +53,9 @@ public class ApiStreamResultTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0")] // an empty production reports zero segments
|
||||
[InlineData("1")] // a single segment production
|
||||
[InlineData("42")] // a multi segment production
|
||||
[InlineData("0")] // An empty production reports zero segments.
|
||||
[InlineData("1")] // A single segment production.
|
||||
[InlineData("42")] // A multi segment production.
|
||||
public async Task CreateAsync_WhenSegmentCountIsValid_ShouldExposeIt(string segmentCount)
|
||||
{
|
||||
// Arrange
|
||||
@@ -70,11 +70,11 @@ public class ApiStreamResultTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // the header is absent
|
||||
[InlineData("")] // the header is empty
|
||||
[InlineData("not-a-number")] // the header is malformed
|
||||
[InlineData("-1")] // a negative count is treated as absent
|
||||
[InlineData("1.5")] // a fractional count is treated as absent
|
||||
[InlineData(null)] // The header is absent.
|
||||
[InlineData("")] // The header is empty.
|
||||
[InlineData("not-a-number")] // The header is malformed.
|
||||
[InlineData("-1")] // A negative count is treated as absent.
|
||||
[InlineData("1.5")] // A fractional count is treated as absent.
|
||||
public async Task CreateAsync_WhenSegmentCountIsInvalid_ShouldReturnNull(string? segmentCount)
|
||||
{
|
||||
// Arrange
|
||||
@@ -90,9 +90,9 @@ public class ApiStreamResultTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0")] // the first segment starts at the beginning of the track
|
||||
[InlineData("6.5")] // a decimal with a dot is forwarded as the API wrote it
|
||||
[InlineData("6,5")] // a decimal with a comma, which is not the invariant separator, is still forwarded verbatim
|
||||
[InlineData("0")] // The first segment starts at the beginning of the track.
|
||||
[InlineData("6.5")] // A decimal with a dot is forwarded as the API wrote it.
|
||||
[InlineData("6,5")] // A decimal with a comma, which is not the invariant separator, is still forwarded verbatim.
|
||||
public async Task CreateAsync_WhenSegmentStartIsPresent_ShouldForwardItVerbatim(string segmentStart)
|
||||
{
|
||||
// Arrange
|
||||
@@ -120,8 +120,8 @@ public class ApiStreamResultTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("1")] // a one second production
|
||||
[InlineData("300")] // a five minute production
|
||||
[InlineData("1")] // A one second production.
|
||||
[InlineData("300")] // A five minute production.
|
||||
public async Task CreateAsync_WhenTrackDurationIsPositive_ShouldExposeIt(string trackDuration)
|
||||
{
|
||||
// Arrange
|
||||
@@ -136,10 +136,10 @@ public class ApiStreamResultTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // the header is absent
|
||||
[InlineData("0")] // a zero duration is treated as absent
|
||||
[InlineData("-5")] // a negative duration is treated as absent
|
||||
[InlineData("not-a-number")] // the header is malformed
|
||||
[InlineData(null)] // The header is absent.
|
||||
[InlineData("0")] // A zero duration is treated as absent.
|
||||
[InlineData("-5")] // A negative duration is treated as absent.
|
||||
[InlineData("not-a-number")] // The header is malformed.
|
||||
public async Task CreateAsync_WhenTrackDurationIsInvalid_ShouldReturnNull(string? trackDuration)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -111,9 +111,9 @@ public class StreamingApiHttpClientTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(false, null)] // there is no HTTP context at all
|
||||
[InlineData(true, null)] // the HTTP context has no token claim
|
||||
[InlineData(true, "")] // the token claim is empty
|
||||
[InlineData(false, null)] // There is no HTTP context at all.
|
||||
[InlineData(true, null)] // The HTTP context has no token claim.
|
||||
[InlineData(true, "")] // The token claim is empty.
|
||||
public async Task GetStreamAsync_WhenTokenIsUnavailable_ShouldNotSendAnAuthorizationHeader(bool hasHttpContext, string? token)
|
||||
{
|
||||
// Arrange
|
||||
@@ -181,8 +181,8 @@ public class StreamingApiHttpClientTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HttpStatusCode.NotModified)] // a conditional request that the entity tag did not invalidate
|
||||
[InlineData(HttpStatusCode.RequestedRangeNotSatisfiable)] // a ranged request that cannot be satisfied
|
||||
[InlineData(HttpStatusCode.NotModified)] // A conditional request that the entity tag did not invalidate.
|
||||
[InlineData(HttpStatusCode.RequestedRangeNotSatisfiable)] // A ranged request that cannot be satisfied.
|
||||
public async Task GetStreamAsync_WhenApiReturnsANonSuccessThatIsAValidOutcome_ShouldPassTheResponseThrough(HttpStatusCode statusCode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -197,9 +197,9 @@ public class StreamingApiHttpClientTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(HttpStatusCode.BadRequest)] // a malformed request
|
||||
[InlineData(HttpStatusCode.NotFound)] // the track does not exist
|
||||
[InlineData(HttpStatusCode.InternalServerError)] // the API failed
|
||||
[InlineData(HttpStatusCode.BadRequest)] // A malformed request.
|
||||
[InlineData(HttpStatusCode.NotFound)] // The track does not exist.
|
||||
[InlineData(HttpStatusCode.InternalServerError)] // The API failed.
|
||||
public async Task GetStreamAsync_WhenApiReturnsAnotherNonSuccess_ShouldThrowApiExceptionWithTheProblemDetails(HttpStatusCode statusCode)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class ApiReachabilityHealthCheckTests
|
||||
/// <returns>The created <see cref="HealthCheckContext"/> instance.</returns>
|
||||
private static HealthCheckContext CreateHealthCheckContext(IHealthCheck healthCheck)
|
||||
{
|
||||
// the ApiReachabilityHealthCheck never reads the registration, so a bare context is sufficient
|
||||
// The ApiReachabilityHealthCheck never reads the registration, so a bare context is sufficient.
|
||||
return new HealthCheckContext();
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -85,9 +85,9 @@ public class ApiStreamProxyTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("public, max-age=60", new[] { "private", "max-age=60" })] // the public instruction is dropped and the max age is preserved
|
||||
[InlineData("no-store", new[] { "private", "no-store" })] // the no store instruction is preserved and privacy is added
|
||||
[InlineData(null, new[] { "private" })] // an absent API instruction becomes a private instruction
|
||||
[InlineData("public, max-age=60", new[] { "private", "max-age=60" })] // The public instruction is dropped and the max age is preserved.
|
||||
[InlineData("no-store", new[] { "private", "no-store" })] // The no store instruction is preserved and privacy is added.
|
||||
[InlineData(null, new[] { "private" })] // An absent API instruction becomes a private instruction.
|
||||
public async Task WriteAsync_WhenApiDeclaresCaching_ShouldAlwaysProduceAPrivateInstruction(string? apiCacheControl, string[] expectedFragments)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+13
-13
@@ -13,10 +13,10 @@ namespace Lumina.Presentation.Web.UnitTests.Common.Playback;
|
||||
public class PlaybackDeliveryIdTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("0123456789abcdef0123456789abcdef")] // a lowercase hexadecimal handle
|
||||
[InlineData("ffffffffffffffffffffffffffffffff")] // an all lowercase hexadecimal handle
|
||||
[InlineData("00000000000000000000000000000000")] // an all zero handle
|
||||
[InlineData("8f14e45fceea167a5a36dedd4bea2543")] // a random lowercase hexadecimal handle
|
||||
[InlineData("0123456789abcdef0123456789abcdef")] // A lowercase hexadecimal handle.
|
||||
[InlineData("ffffffffffffffffffffffffffffffff")] // An all lowercase hexadecimal handle.
|
||||
[InlineData("00000000000000000000000000000000")] // An all zero handle.
|
||||
[InlineData("8f14e45fceea167a5a36dedd4bea2543")] // A random lowercase hexadecimal handle.
|
||||
public void IsValid_WhenValueIsThirtyTwoLowercaseHexadecimalCharacters_ShouldReturnTrue(string value)
|
||||
{
|
||||
// Act
|
||||
@@ -27,15 +27,15 @@ public class PlaybackDeliveryIdTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // an absent handle is not valid
|
||||
[InlineData("")] // an empty handle is not valid
|
||||
[InlineData(" ")] // a whitespace only handle is not valid
|
||||
[InlineData("0123456789abcdef0123456789abcde")] // a handle with 31 characters is too short
|
||||
[InlineData("0123456789abcdef0123456789abcdef0")] // a handle with 33 characters is too long
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF")] // an uppercase handle is not accepted
|
||||
[InlineData("01234567-89ab-cdef-0123-456789abcdef")] // a dashed GUID is not accepted
|
||||
[InlineData("0123456789abcdef0123456789abcdeg")] // a non hexadecimal handle is not accepted
|
||||
[InlineData("0123456789abcdef0123456789abcde ")] // a handle with a trailing space is not accepted
|
||||
[InlineData(null)] // An absent handle is not valid.
|
||||
[InlineData("")] // An empty handle is not valid.
|
||||
[InlineData(" ")] // A whitespace only handle is not valid.
|
||||
[InlineData("0123456789abcdef0123456789abcde")] // A handle with 31 characters is too short.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0")] // A handle with 33 characters is too long.
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF")] // An uppercase handle is not accepted.
|
||||
[InlineData("01234567-89ab-cdef-0123-456789abcdef")] // A dashed GUID is not accepted.
|
||||
[InlineData("0123456789abcdef0123456789abcdeg")] // A non hexadecimal handle is not accepted.
|
||||
[InlineData("0123456789abcdef0123456789abcde ")] // A handle with a trailing space is not accepted.
|
||||
public void IsValid_WhenValueDoesNotMatchTheHandleFormat_ShouldReturnFalse(string? value)
|
||||
{
|
||||
// Act
|
||||
|
||||
+4
-4
@@ -33,8 +33,8 @@ public class ServerConfigurationModelValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData((ushort)0)] // minimum allowed value
|
||||
[InlineData((ushort)65535)] // maximum allowed value
|
||||
[InlineData((ushort)0)] // Minimum allowed value.
|
||||
[InlineData((ushort)65535)] // Maximum allowed value.
|
||||
public void Validate_WhenPortIsAtBoundary_ShouldNotHaveValidationError(ushort port)
|
||||
{
|
||||
// Arrange
|
||||
@@ -48,8 +48,8 @@ public class ServerConfigurationModelValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData((char)0)] // minimum allowed API version
|
||||
[InlineData((char)255)] // maximum allowed API version
|
||||
[InlineData((char)0)] // Minimum allowed API version.
|
||||
[InlineData((char)255)] // Maximum allowed API version.
|
||||
public void Validate_WhenApiVersionIsAtBoundary_ShouldNotHaveValidationError(char apiVersion)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in new issue
Block a user