示例#1
0
        public async void GetBenefitDetails_ShouldCallService()
        {
            // Arrange
            _mockService.Setup(_ => _.GetBenefitDetails(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync(It.IsAny <BenefitsClaim>());

            // Act
            var result = await _controller.GetBenefitDetails(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>());

            // Assert
            _mockService.Verify(_ => _.GetBenefitDetails(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>()), Times.Once);
            var actionResult = Assert.IsType <OkObjectResult>(result);

            Assert.Equal(200, actionResult.StatusCode);
        }