示例#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);
        }
示例#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);
        }
示例#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));
        }
示例#4
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>));
        }
示例#5
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));
        }
示例#6
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);
        }
示例#7
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));
        }