public void Details_ReturnsCorrectView_True() { //Arrange PatronsController controller = new PatronsController(); //Act ActionResult detailView = controller.Details(1); //Assert Assert.IsInstanceOfType(detailView, typeof(ViewResult)); }
public void UpdateForm_ReturnsCorrectView_True() { //Arrange PatronsController controller = new PatronsController(); //Act ActionResult updateView = controller.UpdateForm(1); //Assert Assert.IsInstanceOfType(updateView, typeof(ViewResult)); }
public void Index_ReturnsCorrectView_True() { //Arrange PatronsController controller = new PatronsController(); //Act ActionResult indexView = controller.Index(); //Assert Assert.IsInstanceOfType(indexView, typeof(ViewResult)); }
public void Details_HasCorrectModelType_PatronList() { //Arrange PatronsController controller = new PatronsController(); IActionResult actionResult = controller.Details(1); ViewResult detailView = controller.Details(1) as ViewResult; //Act var result = detailView.ViewData.Model; //Assert Assert.IsInstanceOfType(result, typeof(Dictionary <string, object>)); }
public void Index_HasCorrectModelType_PatronList() { //Arrange PatronsController controller = new PatronsController(); IActionResult actionResult = controller.Index(); ViewResult indexView = controller.Index() as ViewResult; //Act var result = indexView.ViewData.Model; //Assert Assert.IsInstanceOfType(result, typeof(List <Patron>)); }
public void Initialize() { patronRepo = new InMemoryRepository <Patron>(); holdingRepo = new InMemoryRepository <Holding>(); controller = new PatronsController(patronRepo, holdingRepo); }
public PatronsControllerTest(DbContextFixture fixture) { fixture.Seed(); context = new LibraryContext(fixture.ContextOptions); controller = new PatronsController(context); }