mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09: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
+4
-4
@@ -63,7 +63,7 @@ public class BookTests
|
||||
book.UpdateContributors([replacementContributor]);
|
||||
|
||||
// Assert
|
||||
// the previous contributors are replaced, not appended
|
||||
// The previous contributors are replaced, not appended.
|
||||
BookMediaContributor contributor = Assert.Single(book.Contributors);
|
||||
Assert.Equal(replacementContributor, contributor);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ public class BookTests
|
||||
[.. enrichedSource.Ratings]);
|
||||
|
||||
// Assert
|
||||
// the metadata and related fields are replaced with the enriched values
|
||||
// The metadata and related fields are replaced with the enriched values.
|
||||
Assert.Equal(enrichedSource.Metadata, book.Metadata);
|
||||
Assert.Equal(enrichedSource.Format, book.Format);
|
||||
Assert.Equal(enrichedSource.Edition, book.Edition);
|
||||
@@ -233,7 +233,7 @@ public class BookTests
|
||||
[.. secondEnrichmentSource.Ratings]);
|
||||
|
||||
// Assert
|
||||
// the second enrichment replaces the first, it is not appended to it
|
||||
// The second enrichment replaces the first, it is not appended to it.
|
||||
Assert.Equal(secondEnrichmentSource.ISBNs.Count, book.ISBNs.Count);
|
||||
Assert.Equal(secondEnrichmentSource.ISBNs, book.ISBNs);
|
||||
Assert.Equal(secondEnrichmentSource.Ratings, book.Ratings);
|
||||
@@ -253,7 +253,7 @@ public class BookTests
|
||||
bool hasCoverImagePath = bookType.GetProperty("CoverImagePath") is not null;
|
||||
|
||||
// Assert
|
||||
// the enrichment state is a persistence concern, tracked on the repository entity by the enrichment jobs
|
||||
// The enrichment state is a persistence concern, tracked on the repository entity by the enrichment jobs.
|
||||
Assert.False(hasMetadataStatus);
|
||||
Assert.False(hasLastMetadataUpdateUtc);
|
||||
Assert.False(hasMetadataProvider);
|
||||
|
||||
+2
-2
@@ -38,8 +38,8 @@ public class BookRatingTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // negative value
|
||||
[InlineData(-0.5)] // negative fractional value
|
||||
[InlineData(-1)] // Negative value.
|
||||
[InlineData(-0.5)] // Negative fractional value.
|
||||
public void Create_WhenValueIsNegative_ShouldReturnError(double value)
|
||||
{
|
||||
// Act
|
||||
|
||||
+18
-18
@@ -42,9 +42,9 @@ public class IsbnTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // null ISBN value
|
||||
[InlineData("")] // empty ISBN value
|
||||
[InlineData(" ")] // whitespace ISBN value
|
||||
[InlineData(null)] // Null ISBN value.
|
||||
[InlineData("")] // Empty ISBN value.
|
||||
[InlineData(" ")] // Whitespace ISBN value.
|
||||
public void Create_WhenValueIsNullOrWhitespace_ShouldReturnError(string? value)
|
||||
{
|
||||
// Act
|
||||
@@ -100,8 +100,8 @@ public class IsbnTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0-306-40615-2")] // valid ISBN-10 with hyphens
|
||||
[InlineData("0306406152")] // valid ISBN-10 without hyphens
|
||||
[InlineData("0-306-40615-2")] // Valid ISBN-10 with hyphens.
|
||||
[InlineData("0306406152")] // Valid ISBN-10 without hyphens.
|
||||
public void IsValidIsbn10_WhenValueIsValid_ShouldReturnTrue(string isbn)
|
||||
{
|
||||
// Act
|
||||
@@ -112,11 +112,11 @@ public class IsbnTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0-306-40615-3")] // invalid check digit
|
||||
[InlineData("030640615")] // too short
|
||||
[InlineData("03064061523")] // too long
|
||||
[InlineData("")] // empty value
|
||||
[InlineData("ISBN 0-306-40615-2")] // ISBN prefix is not stripped by the checksum computation
|
||||
[InlineData("0-306-40615-3")] // Invalid check digit.
|
||||
[InlineData("030640615")] // Too short.
|
||||
[InlineData("03064061523")] // Too long.
|
||||
[InlineData("")] // Empty value.
|
||||
[InlineData("ISBN 0-306-40615-2")] // ISBN prefix is not stripped by the checksum computation.
|
||||
public void IsValidIsbn10_WhenValueIsInvalid_ShouldReturnFalse(string isbn)
|
||||
{
|
||||
// Act
|
||||
@@ -127,9 +127,9 @@ public class IsbnTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("978-0-306-40615-7")] // valid ISBN-13 with hyphens
|
||||
[InlineData("9780306406157")] // valid ISBN-13 without hyphens
|
||||
[InlineData("979-0-306-40615-6")] // valid ISBN-13 with 979 prefix
|
||||
[InlineData("978-0-306-40615-7")] // Valid ISBN-13 with hyphens.
|
||||
[InlineData("9780306406157")] // Valid ISBN-13 without hyphens.
|
||||
[InlineData("979-0-306-40615-6")] // Valid ISBN-13 with 979 prefix.
|
||||
public void IsValidIsbn13_WhenValueIsValid_ShouldReturnTrue(string isbn)
|
||||
{
|
||||
// Act
|
||||
@@ -140,11 +140,11 @@ public class IsbnTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("978-0-306-40615-8")] // invalid check digit
|
||||
[InlineData("978030640615")] // too short
|
||||
[InlineData("97803064061578")] // too long
|
||||
[InlineData("")] // empty value
|
||||
[InlineData("ISBN 978-0-306-40615-7")] // ISBN prefix is not stripped by the checksum computation
|
||||
[InlineData("978-0-306-40615-8")] // Invalid check digit.
|
||||
[InlineData("978030640615")] // Too short.
|
||||
[InlineData("97803064061578")] // Too long.
|
||||
[InlineData("")] // Empty value.
|
||||
[InlineData("ISBN 978-0-306-40615-7")] // ISBN prefix is not stripped by the checksum computation.
|
||||
public void IsValidIsbn13_WhenValueIsInvalid_ShouldReturnFalse(string isbn)
|
||||
{
|
||||
// Act
|
||||
|
||||
Reference in new issue
Block a user