Beispiel #1
0
        public async Task Index()
        {
            var resultado = await ratecontroller.Index();

            Assert.IsNotNull(resultado);
            Assert.IsTrue(resultado is ActionResult);
        }
Beispiel #2
0
        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());
        }