コード例 #1
0
        public async Task UpdateDiscountSuccessfully()
        {
            //Arrange
            var expectedCoupon = this.DesiredDiscount;

            _mockDiscountRepository.Setup(x => x.UpdateDiscount(It.IsAny <Coupon>())).ReturnsAsync(true);

            //Act
            var result = await _sut.UpdateDiscount(expectedCoupon);

            //Assert
            Assert.NotNull(result);
            var response = Assert.IsType <ActionResult <bool> >(result);
            var okResult = response.Result as OkObjectResult;

            Assert.True(Convert.ToBoolean(okResult.Value));
        }