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