public void DB_CreateNewEntry_Test() { // Arrange PeoplesController controller = new PeoplesController(db); People testPeople = new People(); testPeople.Name = "TestDb People"; // Act controller.Create(testPeople); var collection = (controller.Index() as ViewResult).ViewData.Model as IEnumerable <People>; // Assert Assert.Contains <People>(testPeople, collection); }
public void Mock_ConfirmEntry_Test() { // Arrange DbSetup(); PeoplesController controller = new PeoplesController(mock.Object); People testPeople = new People(); testPeople.Name = "Joe"; testPeople.PersonId = 1; //Act ViewResult indexView = controller.Index() as ViewResult; var collection = indexView.ViewData.Model as IEnumerable <People>; //Assert Assert.Contains <People>(testPeople, collection); }