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); }
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()); }
public void Index_View_Data_Test() { DonorController controller = new DonorController(); ViewResult view = controller.Index(); Assert.IsInstanceOfType(view.ViewData.Model, typeof(List <BLL.Donor>)); }
public void Index_View_Test() { DonorController controller = new DonorController(); ViewResult view = controller.Index(); Assert.AreEqual("", view.ViewName); }
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()); }
public void CanShowIndex() { var result = _donorController.Index(); Assert.IsNotNull(result); }