public async void DetailsCoachNotFoundPageTest() { //Arrange var db = MockDb.CreateMockDb(); var c = new StadiumsController(db); //Act var r = await c.Details(2); //Assert Assert.IsType <NotFoundResult>(r); }
public async void DetailPageTest() { //Arrange var db = MockDb.CreateMockDb(); var c = new StadiumsController(db); var stadiums = new Stadium { Stadium_Id = 2, StadiumName = "Ever After", City = "Everett", Team_Id = 1 }; //Act await c.Create(stadiums); var r = await c.Details(db.Stadium.Find(2).Stadium_Id); //Assert var result = Assert.IsType <ViewResult>(r); var model = Assert.IsAssignableFrom <Stadium>(result.ViewData.Model); Assert.Equal(db.Stadium.Find(2).Stadium_Id, model.Stadium_Id); Assert.Equal(db.Stadium.Find(2).StadiumName, model.StadiumName); }