public async Task Index() { var resultado = await ratecontroller.Index(); Assert.IsNotNull(resultado); Assert.IsTrue(resultado is ActionResult); }
public async Task IndexGet() { //arrange RatesController ratesController = new RatesController(Mocks.GetMapper(), Mocks.GetRatesRepository(), Mocks.GetProductRepository(), Mocks.GetMockUserManager()); Mocks.FillController(ratesController); //act IActionResult result = await ratesController.Index(); //assert Assert.AreEqual(typeof(ViewResult), result.GetType()); ViewResult viewResult = (ViewResult)result; Assert.AreEqual(typeof(RatesViewModel), viewResult.Model.GetType()); }