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); }
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); }
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)); }
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>)); }
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)); }
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); }
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)); }