public async Task GetPaybackTime_When_Invalid_Returns_NotFoundResponse( [Frozen] Mock <IQuoteManager> _quoteManager, [Greedy] QuoteController sut) { // Arrange _quoteManager.Setup(x => x.GetPaybackTime()).ReturnsAsync(new List <PaybackTimeVM>()); // Act var result = await sut.GetPaybackTime(); var response = result as BadRequestObjectResult; // Assert Assert.NotNull(result); Assert.Equal(400, response.StatusCode); }
public async Task GetPaybackTime_When_Valid_Returns_SuccessResponse( [Frozen] Mock <IQuoteManager> _quoteManager, List <PaybackTimeVM> moqResponse, [Greedy] QuoteController sut ) { // Arrange _quoteManager.Setup(x => x.GetPaybackTime()).ReturnsAsync(moqResponse); // Act var result = await sut.GetPaybackTime(); var response = result as OkObjectResult; // Assert Assert.NotNull(result); Assert.Equal(200, response.StatusCode); }