Exemple #1
0
        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, "");
        }
Exemple #2
0
        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, "");
        }
Exemple #3
0
        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");
        }