public async void UpdateMarkSessionType_InternalServerErrorStatusCode_ThrowsException() { // Arrange var httpResponseMessage = new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent("") }; var httpService = new Mock <IHttpService>(); httpService .Setup(m => m.PutAsync(It.IsAny <string>(), It.IsAny <string>())) .ReturnsAsync(httpResponseMessage); var markingServiceClient = new MarkingServiceClient(httpService.Object); Exception exception = null; try { // Act await markingServiceClient.UpdateMarkSessionType(It.IsAny <string>(), It.IsAny <string>()); } catch (Exception e) { exception = e; } // Assert Assert.NotNull(exception); }
public async void UpdateMarkSessionType_MarkSessionModelExists_NoExceptionThrown() { // Arrange var markSessionId = "5b07dee57aa54a0007b3db52"; var markSessionType = MarkingServiceClient.MarkSessionTypeToBeDeleted; var httpService = new HttpService(new HttpClient()); var markingServiceClient = new MarkingServiceClient(httpService); Exception exception = null; try { // Act await markingServiceClient.UpdateMarkSessionType(markSessionId, markSessionType); } catch (Exception e) { exception = e; } // Assert Assert.Null(exception); }