public void Mock_GetViewResultOfferIndex_ActionResult() // Confirms route returns view { //Arrange DbSetup(); OffersController controller = new OffersController(mock.Object); //Act var result = controller.Index(); //Assert Assert.IsInstanceOfType(result, typeof(ActionResult)); }
public void TestDB_CreateOffer_Adds() { OffersController controller = new OffersController(db); Offer newOffer = new Offer { OfferId = 100, Name = "HFBW" }; controller.Create(newOffer); var newList = (controller.Index() as ViewResult).ViewData.Model as List <Offer>; CollectionAssert.Contains(newList, newOffer); db.DeleteAll(); }