From 0ad319f2450f8930998063e0085634ad30807c42 Mon Sep 17 00:00:00 2001 From: Ted Wollman <25165500+TheTedder@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:52:35 -0400 Subject: [PATCH] Test the includeDeleted parameter. --- LeaderboardBackend.Test/Leaderboards.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/LeaderboardBackend.Test/Leaderboards.cs b/LeaderboardBackend.Test/Leaderboards.cs index 44845d9a..2e7c5862 100644 --- a/LeaderboardBackend.Test/Leaderboards.cs +++ b/LeaderboardBackend.Test/Leaderboards.cs @@ -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() } ]; @@ -350,6 +351,12 @@ public async Task GetLeaderboards() await context.SaveChangesAsync(); LeaderboardViewModel[] returned = await _apiClient.Get("/api/leaderboards", new()); returned.Should().BeEquivalentTo(boards.Take(2), config => config.Excluding(lb => lb.Categories)); + + LeaderboardViewModel[] returned2 = await _apiClient.Get("/api/leaderboards?includeDeleted=false", new()); + returned2.Should().BeEquivalentTo(boards.Take(2), config => config.Excluding(lb => lb.Categories)); + + LeaderboardViewModel[] returned3 = await _apiClient.Get("/api/leaderboards?includeDeleted=true", new()); + returned3.Should().BeEquivalentTo(boards, config => config.Excluding(lb => lb.Categories)); } [Test]