-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Resolves #522 * WIP export * Fix an issue that caused the game name to be null in ticket markdown export * Fixed an issue where challenges from games with no end date wouldn't appear in the ticket challenge picker * Add cancellation tokens to report endpoints, fix denorm bug for new scoring teams. * Cleanup * Minor cleanup * WIP import/export * Fix flailing test and more defense for session time stuff * WIP import/export * MVP import/export endpoints * Fix 'top performance' for #594 * Add 'completed teams' to game center for #594 * Remove old cert stuff. Rename RequirePermissions to Require. Fix tests * Remove version endpoint since we no longer support it anyway. * Resolve #572 * Fixed autotagging bug and minor cleanup * Fix autotagging bugs, add observe to practice tab, fix import/export stuff * Fix bug that prevented feedback from loading for support personnel * Fix enrollment report unstarted teams calc. Fix challenge launch failure after an attempt that is canceled * Align calculation of 'team has started' logic * Minor cleanup * Add export download endpoint * Add missing export field * Add missing field * Hide test in dev
- Loading branch information
1 parent
38c11b2
commit cbe2bd2
Showing
136 changed files
with
6,367 additions
and
877 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
...ts.Integration/Tests/Features/Certificates/CertificatesController_GetCertificatesTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
namespace Gameboard.Api.Tests.Integration; | ||
|
||
public class CertificatesControllerTests_GetCertificatesTests(GameboardTestContext testContext) : IClassFixture<GameboardTestContext> | ||
{ | ||
private readonly GameboardTestContext _testContext = testContext; | ||
|
||
// [Theory, GbIntegrationAutoData] | ||
// public async Task GetCertificates_WhenScoreConstrained_ReturnsExpectedCount | ||
// ( | ||
// int score, | ||
// string scoringUserId, | ||
// string scoringPlayerId, | ||
// string nonScoringUserId, | ||
// string nonScoringPlayerId, | ||
// IFixture fixture | ||
// ) | ||
// { | ||
// // given | ||
// var now = DateTimeOffset.UtcNow; | ||
|
||
// await _testContext.WithDataState(state => | ||
// { | ||
// state.Add<Data.Game>(fixture, g => | ||
// { | ||
// g.GameEnd = now - TimeSpan.FromDays(1); | ||
// g.CertificateTemplateLegacy = "This is a template with a {{player_count}}."; | ||
// g.Players = | ||
// [ | ||
// // i almost broke my brain trying to get GbIntegrationAutoData to work with | ||
// // inline autodata, so I'm just doing two checks here | ||
// state.Build<Data.Player>(fixture, p => | ||
// { | ||
// p.Id = scoringPlayerId; | ||
// p.User = state.Build<Data.User>(fixture, u => u.Id = scoringUserId); | ||
// p.UserId = scoringUserId; | ||
// p.SessionEnd = now - TimeSpan.FromDays(-2); | ||
// p.TeamId = "teamId"; | ||
// p.Score = score; | ||
// }), | ||
// state.Build<Data.Player>(fixture, p => | ||
// { | ||
// p.Id = nonScoringPlayerId; | ||
// p.User = state.Build<Data.User>(fixture, u => u.Id = nonScoringUserId); | ||
// p.UserId = nonScoringUserId; | ||
// p.SessionEnd = now - TimeSpan.FromDays(-2); | ||
// p.TeamId = "teamId"; | ||
// p.Score = score; | ||
// }) | ||
// ]; | ||
// }); | ||
// }); | ||
|
||
// var httpClient = _testContext.CreateHttpClientWithActingUser(u => u.Id = scoringUserId); | ||
|
||
// // when | ||
// var certs = await httpClient | ||
// .GetAsync("/api/certificates") | ||
// .DeserializeResponseAs<IEnumerable<PlayerCertificate>>(); | ||
|
||
// // then | ||
// certs?.Count().ShouldBe(1); | ||
// certs?.First().Player.Id.ShouldBe(scoringPlayerId); | ||
// } | ||
|
||
// [Theory, GbIntegrationAutoData] | ||
// public async Task GetCertificates_WithTeamsAndNonScorers_ReturnsExpected(string teamId, string userId, IFixture fixture) | ||
// { | ||
// // given | ||
// var now = DateTimeOffset.UtcNow; | ||
// var recentDate = DateTime.UtcNow.AddDays(-1); | ||
|
||
// await _testContext.WithDataState(state => | ||
// { | ||
// state.Add<Data.Game>(fixture, g => | ||
// { | ||
// g.CertificateTemplateLegacy = "This is a template with a {{player_count}} and a {{team_count}}."; | ||
// g.GameEnd = now - TimeSpan.FromDays(1); | ||
// g.Players = new List<Data.Player> | ||
// { | ||
// // three players with nonzero score (2 on the same team) | ||
// state.Build<Data.Player>(fixture, p => | ||
// { | ||
// p.SessionEnd = recentDate; | ||
// p.Score = 20; | ||
// p.User = state.Build<Data.User>(fixture, u => u.Id = userId); | ||
// }), | ||
// state.Build<Data.Player>(fixture, p => | ||
// { | ||
// p.SessionEnd = recentDate; | ||
// p.Score = 30; | ||
// p.TeamId = teamId; | ||
// }), | ||
// state.Build<Data.Player>(fixture, p => | ||
// { | ||
// p.SessionEnd = recentDate; | ||
// p.Score = 30; | ||
// p.TeamId = teamId; | ||
// }), | ||
// // one player with zero score | ||
// state.Build<Data.Player>(fixture, p => | ||
// { | ||
// p.SessionEnd = recentDate; | ||
// p.Score = 0; | ||
// }), | ||
// }; | ||
// }); | ||
// }); | ||
|
||
// var httpClient = _testContext.CreateHttpClientWithActingUser(u => u.Id = userId); | ||
|
||
// // when | ||
// var certsResponse = await httpClient | ||
// .GetAsync("/api/certificates") | ||
// .DeserializeResponseAs<IEnumerable<PlayerCertificate>>(); | ||
|
||
// // then | ||
// var certs = certsResponse.ToArray(); | ||
// certs.ShouldNotBeNull(); | ||
// certs.Count().ShouldBe(1); | ||
// certs.First().Html.ShouldBe("This is a template with a 3 and a 2."); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.