public async Task AddSuite_WhenFieldsHaveCorrectValues_ShouldReturnOK_ShouldReturnOk() { //Arrange SetUpAuthorization(); var project = await _projectSteps.AddProject(ProjectFactory.GetProjectModel()); var suiteModel = SuiteFactory.GetSuiteModel(); //Act var response = await _suiteService.AddSuite(project.Id, suiteModel); //Assert response.ResponseStatusCode(HttpStatusCode.OK, "Expected OK status."); var responseModel = await response.GetContentModel <SuiteResponse>(); var expectedResponse = SuiteResponseFactory.SuiteResponseModel(suiteModel); SuiteAssertion.AssertSuite(expectedResponse, responseModel); }
public async Task UpdateSuite_WhenSuiteIsExistedShouldReturnOk() { //Arrange SetUpAuthorization(); var project = await _projectSteps.AddProject(ProjectFactory.GetProjectModel()); var createdSuite = await _suiteSteps.AddSuite(project.Id, SuiteFactory.GetSuiteModel()); var suiteModel = SuiteFactory.GetSuiteModel(); var expectedSuite = SuiteResponseFactory.SuiteResponseModel(suiteModel); //Act var response = await _suiteService.UpdateSuite(createdSuite.Id, suiteModel); //Assert response.ResponseStatusCode(HttpStatusCode.OK, "Expected OK status."); var responseSuite = await response.GetContentModel <SuiteResponse>(); SuiteAssertion.AssertSuite(expectedSuite, responseSuite); }