Skip to content

Commit

Permalink
Test the includeDeleted parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTedder committed Oct 28, 2024
1 parent 08f8b06 commit 0ad319f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions LeaderboardBackend.Test/Leaderboards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ public async Task GetLeaderboards()
Name = "Link: The Faces of Evil",
Slug = "link-faces-of-evil",
Info = "Nobody should play this one.",
UpdatedAt = _clock.GetCurrentInstant(),
DeletedAt = _clock.GetCurrentInstant()
}
];
Expand All @@ -350,6 +351,12 @@ public async Task GetLeaderboards()
await context.SaveChangesAsync();
LeaderboardViewModel[] returned = await _apiClient.Get<LeaderboardViewModel[]>("/api/leaderboards", new());
returned.Should().BeEquivalentTo(boards.Take(2), config => config.Excluding(lb => lb.Categories));

LeaderboardViewModel[] returned2 = await _apiClient.Get<LeaderboardViewModel[]>("/api/leaderboards?includeDeleted=false", new());
returned2.Should().BeEquivalentTo(boards.Take(2), config => config.Excluding(lb => lb.Categories));

LeaderboardViewModel[] returned3 = await _apiClient.Get<LeaderboardViewModel[]>("/api/leaderboards?includeDeleted=true", new());
returned3.Should().BeEquivalentTo(boards, config => config.Excluding(lb => lb.Categories));
}

[Test]
Expand Down

0 comments on commit 0ad319f

Please sign in to comment.