public void slettVare() { var controller = new VareController(new VareBLL(new VareDALStub())); // Act var actionResult = (ViewResult)controller.slettVare(1); var resultat = (Kunde)actionResult.Model; // Assert Assert.AreEqual(actionResult.ViewName, ""); }
public void Slett_ikke_funnet_Post() { // Arrange var controller = new VareController(new VareBLL(new VareDALStub())); var innVare = new Vare() { ID = 1, Varenavn = "eple", Pris = 5, Varebeholdning = 77 }; // Act var actionResult = (ViewResult)controller.slettVare(0, innVare); // Assert Assert.AreEqual(actionResult.ViewName, ""); }
public void slettVare_funnet() { // Arrange var controller = new VareController(new VareBLL(new VareDALStub())); var innVare = new Vare() { ID = 1, Varenavn = "eple", Pris = 5, Varebeholdning = 77 }; // Act var actionResult = (RedirectToRouteResult)controller.slettVare(1, innVare); // Assert Assert.AreEqual(actionResult.RouteName, ""); Assert.AreEqual(actionResult.RouteValues.Values.First(), "VareListe"); }