Merge phase 26 school seed.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -491,9 +491,13 @@ public class SchoolApiTests(AppHostFixture fixture)
|
||||
return state;
|
||||
}
|
||||
|
||||
internal static async Task<SchoolResponse> CreateAsync(HttpClient client, string name, DateTime startDate)
|
||||
internal static async Task<SchoolResponse> CreateAsync(
|
||||
HttpClient client,
|
||||
string name,
|
||||
DateTime startDate,
|
||||
int? seed = null)
|
||||
{
|
||||
using var response = await PostAsync(client, name, startDate);
|
||||
using var response = await PostAsync(client, name, startDate, seed);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
var created = await response.Content.ReadFromJsonAsync<SchoolResponse>(TestContext.Current.CancellationToken);
|
||||
@@ -526,10 +530,14 @@ public class SchoolApiTests(AppHostFixture fixture)
|
||||
links = new[] { new { a = "yard", b = "office" } },
|
||||
};
|
||||
|
||||
private static Task<HttpResponseMessage> PostAsync(HttpClient client, string name, DateTime startDate) =>
|
||||
private static Task<HttpResponseMessage> PostAsync(
|
||||
HttpClient client,
|
||||
string name,
|
||||
DateTime startDate,
|
||||
int? seed = null) =>
|
||||
client.PostAsJsonAsync(
|
||||
"/api/schools",
|
||||
new { name, startDate },
|
||||
seed is null ? (object)new { name, startDate } : new { name, startDate, seed },
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
private static async Task<string?> ProblemCodeAsync(HttpResponseMessage response)
|
||||
@@ -544,6 +552,7 @@ public class SchoolApiTests(AppHostFixture fixture)
|
||||
DateTime GameTime,
|
||||
bool Running,
|
||||
byte SpeedIndex,
|
||||
int Seed,
|
||||
IReadOnlyList<string>? ModIds = null);
|
||||
|
||||
internal sealed record SchoolsResponse(
|
||||
|
||||
Reference in New Issue
Block a user