Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ This project uses famous football stadiums (A-Z) that hosted FIFA World Cup matc
- Rename `ValidateAsync_SquadNumber_BelongsToPlayerBeingUpdated_ReturnsNoErrors` to `ValidateAsync_SquadNumberBelongsToPlayerBeingUpdated_ReturnsNoErrors` to align with the 3-segment naming convention for service/validator tests (#427)
- Make CSharpier step in `/pre-commit` conditional (skip with a note if not installed), consistent with the Docker and CodeRabbit steps (#427)
- Add "Verify tag commit is reachable from master" step to CD workflow using `git merge-base --is-ancestor` before any build or publish steps (#439)
- Rename five controller test methods to normalize data-state vocabulary: `NonExisting` → `Nonexistent` for the POST 201 scenario, `NonExisting` → `Unknown` for the four 404-by-lookup scenarios (#452)
- Add XML doc `<remarks>` block to `PlayerFakes` documenting the three-term data-state vocabulary (`existing`, `nonexistent`, `unknown`) (#452)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public async Task Post_Players_Existing_Returns409Conflict()

[Fact]
[Trait("Category", "Unit")]
public async Task Post_Players_NonExisting_Returns201Created()
public async Task Post_Players_Nonexistent_Returns201Created()
{
// Arrange
var request = PlayerFakes.MakeRequestModelForCreate();
Expand Down Expand Up @@ -203,7 +203,7 @@ public async Task Get_Players_Empty_Returns200OkWithEmptyList()

[Fact]
[Trait("Category", "Unit")]
public async Task Get_PlayerById_NonExisting_Returns404NotFound()
public async Task Get_PlayerById_Unknown_Returns404NotFound()
{
// Arrange
var id = Guid.NewGuid();
Expand Down Expand Up @@ -248,7 +248,7 @@ public async Task Get_PlayerById_Existing_Returns200OK()

[Fact]
[Trait("Category", "Unit")]
public async Task Get_PlayerBySquadNumber_NonExisting_Returns404NotFound()
public async Task Get_PlayerBySquadNumber_Unknown_Returns404NotFound()
{
// Arrange
var squadNumber = 999;
Expand Down Expand Up @@ -345,7 +345,7 @@ public async Task Put_PlayerBySquadNumber_ValidationError_Returns400BadRequest()

[Fact]
[Trait("Category", "Unit")]
public async Task Put_PlayerBySquadNumber_NonExisting_Returns404NotFound()
public async Task Put_PlayerBySquadNumber_Unknown_Returns404NotFound()
{
// Arrange
var squadNumber = 999;
Expand Down Expand Up @@ -461,7 +461,7 @@ public async Task Put_PlayerBySquadNumber_Existing_Returns204NoContent()

[Fact]
[Trait("Category", "Unit")]
public async Task Delete_PlayerBySquadNumber_NonExisting_Returns404NotFound()
public async Task Delete_PlayerBySquadNumber_Unknown_Returns404NotFound()
{
// Arrange
var squadNumber = 999;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ namespace Dotnet.Samples.AspNetCore.WebApi.Tests.Utilities;
/// useful when you need behavior that's closer to reality but still want
/// to avoid external dependencies.
/// </summary>
/// <remarks>
/// Data-state vocabulary used across controller tests:
/// <list type="bullet">
/// <item><term>existing</term><description>Player is present in the database.</description></item>
/// <item><term>nonexistent</term><description>Player is absent, valid shape for creation (POST scenarios).</description></item>
/// <item><term>unknown</term><description>Valid ID format, absent from database (404-by-lookup scenarios).</description></item>
/// </list>
/// </remarks>
public static class PlayerFakes
{
private static string? FormatBirth(DateTime? dateOfBirth) =>
Expand Down
Loading