public void DeleteTest() { var controller = new BuildingsController(); var result = controller.Index() as ViewResult; var buildings = (ICollection <Building>)result.ViewData.Model; var Id = buildings.Last().BuildingId; controller.DeleteConfirmed(Id); var result2 = controller.Index() as ViewResult; var buildings2 = (ICollection <Building>)result.ViewData.Model; Assert.AreNotEqual(Id, buildings2.Last().BuildingId); }
public void TestDeleteConfirmed() { var result = controller.DeleteConfirmed(3) as HttpNotFoundResult; result.Should().Be(null); }