コード例 #1
0
        public void UpdateSuccess()
        {
            mockService.Setup(_ => _.Update(It.IsAny <UpdateEntityParameter>())).Returns(BaseMockResponse.SuccessResponse());
            var result = mockService.Object.Update(EntityMockParameter.UpdateValidEntityParameter());

            Assert.NotNull(result);
        }
コード例 #2
0
 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);
     }
 }