public void GetEventTest() { //Arrange EventSqlDal eventSqlDal = new EventSqlDal(connectionString); //Act Event eventItem = eventSqlDal.GetEvent(eventID); //Assert Assert.AreEqual(eventID, eventItem.EventID); }
public void GetAllEventsTest() { //Arrange EventSqlDal eventSqlDal = new EventSqlDal(connectionString); //Act List <Event> eventItems = eventSqlDal.GetAllEvents(); //Assert Assert.IsNotNull(eventItems); Assert.AreEqual(eventItems.Count + 1, eventItems.Count); bool found = false; foreach (Event eventItem in eventItems) { if (eventItem.EventName == "Pet Count = 17") { found = true; } Assert.AreEqual(true, found, "Event 'Pet Count = 17' not found in test"); } }