public async Task TrialExamShouldBeCreated() { using var testServer = await CreateWithUserAsync(); var client = testServer.CreateClient(); var command = new CreateExamCommand( Guid.NewGuid(), "3.Trial", DateTime.Now, 7, 0, "Frm3rdGradeTrial", 1, 0, 1, null, Random.RandomString(100)); var response = await client.PostAsync(ApiPath, command.ToJsonContent()); response.EnsureSuccessStatusCode(); var exams = await GetExamListAsync(client); exams.Should().Contain(e => e.Name == command.Name && e.IncorrectEliminationRate == command.IncorrectEliminationRate && e.Notes == command.Notes && e.ExamBookletTypeId == command.ExamBookletTypeId && e.ExamTypeId == command.ExamTypeId); }
protected async Task <CreateExamCommand> CreateExamAsync( HttpClient client) { var examType = await GetRandomExamTypeAsync(client); var command = new CreateExamCommand( Guid.NewGuid(), Random.RandomString(100), DateTime.Today, examType.Id, 3, examType.OpticalFormTypes.Random().Code, 1, 1 + Random.Next(10), 2, null, Random.RandomString(200)); var response = await client.PostAsync(ApiPath, command.ToJsonContent()); response.EnsureSuccessStatusCode(); return(command); }