Esempio n. 1
0
        public void IndexPost_ValidForm_RedirectsToActionResult()
        {
            // mock usermanager?
            _appVariableRepository.Setup(m => m.GetBy("TaxRate")).Returns(_dummyContext.TaxRate); // not needed (taxrate not shown)
            var donationViewModel = new DonationViewModel()
            {
                Amount    = 50000,
                EventType = "Other"
            };
            var actionResult = _controller.Index(donationViewModel) as RedirectToActionResult;

            Assert.Equal("Result", actionResult?.ActionName);
        }
Esempio n. 2
0
        public void Index_View_Data_Count_Test()
        {
            DonorController controller = new DonorController();
            ViewResult      view       = controller.Index();

            Assert.AreEqual(((List <BLL.Donor>)view.ViewData.Model).Count, new BLL.CTSContext().Donors.Count());
        }
Esempio n. 3
0
        public void Index_View_Data_Test()
        {
            DonorController controller = new DonorController();
            ViewResult      view       = controller.Index();

            Assert.IsInstanceOfType(view.ViewData.Model, typeof(List <BLL.Donor>));
        }
Esempio n. 4
0
        public void Index_View_Test()
        {
            DonorController controller = new DonorController();
            ViewResult      view       = controller.Index();

            Assert.AreEqual("", view.ViewName);
        }
Esempio n. 5
0
        public void CanViewIndex()
        {
            //ACT
            var viewResult = _donorController.Index();

            Assert.NotNull(viewResult);
            var model = viewResult.Model;

            //ASSERT
            Assert.IsInstanceOf <Donor>(model);
            Assert.AreEqual(2, ((IEnumerable <Donor>)model).Count());
        }
Esempio n. 6
0
        public void CanShowIndex()
        {
            var result = _donorController.Index();

            Assert.IsNotNull(result);
        }