public void TestKoffieAddCount() { // Arrange var newKoffie = new Koffie { Id = 8, Naam = "Cappuccino", MinimaleInhoudInCl = 12, MaximaleInhoudInCl = 25 }; // Act _koffieAgent.Add(newKoffie); // Assert Assert.AreEqual(3, _koffieAgent.GetAll().Count()); }
public void TestIndexModelListCount() { // Arrange var target = new KoffieController(_koffieAgent); // Act IActionResult actionResult = target.Index(); var model = (actionResult as ViewResult).Model; var result = (model as IEnumerable <Koffie>); // Assert Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(IEnumerable <Koffie>)); Assert.AreEqual(result.Count(), _koffieAgent.GetAll().Count()); }
public IActionResult Index() { var model = _koffieAgent.GetAll(); return(View(model)); }