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

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