public void UpdateSuccess() { mockService.Setup(_ => _.Update(It.IsAny <UpdateLiveParameter>())).Returns(BaseMockResponse.SuccessResponse()); var result = mockService.Object.Update(LiveMockParameter.UpdateLiveParameter()); Assert.NotNull(result); }
public void UpdateFail() { foreach (var statusCode in this.StatusCodes) { mockService.Setup(_ => _.Update(It.IsAny <UpdateLiveParameter>())).Throws(BaseMockResponse.ErrorResponse(statusCode)); var ex = Assert.Throws <UizaException>(() => mockService.Object.Update(LiveMockParameter.UpdateLiveParameter())); Assert.Equal(statusCode, ex.UizaInnerException.Code); } }