public async void UnmarkScenario_MarkedScenarioModel_NoExceptionThrown() { // Assert var dependantResourceModel = new DependantResourceModel( ResourceTypeEnum.Scenario, "aad965db-fceb-4ee2-bd06-c89ab182ca4c" ); var httpService = new HttpService(new HttpClient()); var scenarioClient = new ScenarioClient( httpService ); Exception exception = null; try { // Act await scenarioClient.UnmarkScenario(dependantResourceModel); } catch (Exception e) { exception = e; } // Assert Assert.Null(exception); }
public async void UnmarkScenario_InternalServerErrorStatusCode_ThrowsException() { // Arrange var httpResponseMessage = new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent("Some error!") }; var httpService = new Mock <IHttpService>(); httpService .Setup(m => m.PutAsync(It.IsAny <string>(), It.IsAny <ScenarioModel>())) .ReturnsAsync(httpResponseMessage); var scenarioClient = new ScenarioClient(httpService.Object); Exception exception = null; try { // Act await scenarioClient.UnmarkScenario(DependantResourceDataMocks.MockDependantResourceModel()); } catch (FailedToUpdateResourceException e) { exception = e; } // Assert Assert.NotNull(exception); }