예제 #1
0
        public void VerwijderenMonumentViewResultModelSizeCheck()
        {
            //Arrange

            var dummyList = _CreateDummyList();

            var monumentenController = new MonumentenMockController(
                new MockMonumentAgent()
                );

            monumentenController.setList(dummyList);

            Monument dummyMonument = new Monument();

            monumentenController.Toevoegen(dummyMonument);

            //Act
            IActionResult result = monumentenController.Verwijderen(dummyMonument);

            var resultModel = (List <Monument>)(result as ViewResult).Model;


            //Assert
            Assert.IsNotNull(resultModel);
            Assert.IsInstanceOfType(resultModel, typeof(List <Monument>));
            Assert.AreEqual(1, resultModel.Count);
        }
예제 #2
0
        public void VerwijderenMonumentViewResultModelContentCheck()
        {
            //Arrange
            var dummyList = _CreateDummyList();

            var monumentenController = new MonumentenMockController(
                new MockMonumentAgent()
                );

            monumentenController.setList(dummyList);

            Monument pizzahut = new Monument()
            {
                MonumentNaam = "Pizzahut"
            };

            monumentenController.Toevoegen(pizzahut);
            //Act

            IActionResult result = monumentenController.Verwijderen(pizzahut);

            var resultModel = (List <Monument>)(result as ViewResult).Model;

            //Assert
            Assert.IsNotNull(resultModel);
            Assert.IsInstanceOfType(resultModel, typeof(List <Monument>));
            CollectionAssert.DoesNotContain(resultModel, pizzahut);
        }
예제 #3
0
        public void VerwijderenMonumentViewResultTypeCheck()
        {
            //Arrange

            var dummyList = _CreateDummyList();

            var monumentenController = new MonumentenMockController(
                new MockMonumentAgent()
                );

            monumentenController.setList(dummyList);

            Monument dummyMonument = new Monument();

            monumentenController.Toevoegen(dummyMonument);


            //Act
            IActionResult result = monumentenController.Verwijderen(dummyMonument);



            //Assert
            Assert.IsInstanceOfType((result as ViewResult), typeof(ViewResult));
        }