Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #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));
        }
Beispiel #4
0
        public void IndexViewResultCheckNotNull()
        {
            //Arrange
            var monumentenController = new MonumentenMockController(
                new MockMonumentAgent()
                );

            //Act
            IActionResult result = monumentenController.Index();

            //Assert
            Assert.IsNotNull(result);
        }
Beispiel #5
0
        public void IndexViewResultCheckModelTypeOfMonumenten()
        {
            //Arrange
            var monumentenController = new MonumentenMockController(
                new MockMonumentAgent()
                );

            monumentenController.setList(_CreateDummyList());


            //Act
            IActionResult result      = monumentenController.Index();
            var           resultModel = (List <Monument>)(result as ViewResult).Model;

            //Assert
            Assert.IsNotNull(resultModel);
            Assert.IsInstanceOfType(resultModel, typeof(List <Monument>));
        }
Beispiel #6
0
        public void ToevoegenMonumentViewResultNullCheck()
        {
            //Arrange

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

            monumentenController.setList(_CreateDummyList());

            //Act
            IActionResult result = monumentenController.Toevoegen(new Monument());



            //Assert
            Assert.IsNotNull((result as ViewResult));
        }
Beispiel #7
0
        public void IndexViewResultCheckModelContentGivenDummyList()
        {
            //Arrange

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

            monumentenController.setList(_CreateDummyList());

            //Act
            IActionResult result = monumentenController.Index();

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

            //Assert
            Assert.IsNotNull(resultModel);
            Assert.IsInstanceOfType(resultModel, typeof(List <Monument>));
            Assert.AreEqual("Brandenburgertor", resultModel[0].MonumentNaam);
        }
Beispiel #8
0
        public void ToevoegenPaginaOphalenViewResultTypeCheck()
        {
            //Arrange
            var dummyList = _CreateDummyList();

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

            monumentenController.setList(dummyList);


            //Act

            IActionResult result = monumentenController.Toevoegen();


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