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