public async void GetBenefits_ShouldCallBenefitsService() { // Arrange _mockBenefitsService .Setup(_ => _.GetBenefits(It.IsAny <string>())) .ReturnsAsync(It.IsAny <Claim>()); // Act await _controller.GetBenefits(It.IsAny <string>()); // Assert _mockBenefitsService.Verify(_ => _.GetBenefits(It.IsAny <string>()), Times.Once); }
public async void GetBenefits_ShouldCallService() { // Arrange _mockService.Setup(_ => _.GetBenefits(It.IsAny <string>())) .ReturnsAsync(It.IsAny <List <BenefitsClaimSummary> >()); // Act var result = await _controller.GetBenefits(It.IsAny <string>()); // Assert _mockService.Verify(_ => _.GetBenefits(It.IsAny <string>()), Times.Once); var actionResult = Assert.IsType <OkObjectResult>(result); Assert.Equal(200, actionResult.StatusCode); }