public async void MarkScenario_MarkedScenarioModel_ThrowsException() { // Arrange var httpResponseMessage = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(ScenarioModelDataMocks.MockMarkedScenarioModelJson) }; var httpService = new Mock <IHttpService>(); httpService .Setup(m => m.GetAsync(It.IsAny <string>())) .ReturnsAsync(httpResponseMessage); var scenarioClient = new ScenarioClient(httpService.Object); Exception exception = null; try { // Act await scenarioClient.MarkScenario(It.IsAny <string>()); } catch (ResourceAlreadyMarkedException e) { exception = e; } // Assert Assert.NotNull(exception); }
public async void MarkScenario_UnmarkedScenarioModel_ReturnsDependantResourceModel() { // Assert var scenarioId = "ae7b7512-4233-476b-b3d7-6651aeae6518"; var httpService = new HttpService(new HttpClient()); var scenarioClient = new ScenarioClient( httpService ); // Act var result = await scenarioClient.MarkScenario(scenarioId); // Assert Assert.NotNull(result); }
public async void MarkScenario_ScenarioModel_ReturnsDependantResourceModel() { // Arrange var httpResponseMessage = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent("") }; var httpService = new Mock <IHttpService>(); httpService .Setup(m => m.PutAsync(It.IsAny <string>(), It.IsAny <ScenarioModel>())) .ReturnsAsync(httpResponseMessage); var scenarioClient = new ScenarioClient(httpService.Object); // Act var result = await scenarioClient.MarkScenario(ScenarioModelDataMocks.MockScenarioModel()); // Assert Assert.NotNull(result); }