public void CalendarFirstMethod_test_2() { // test of: "first" method in combination with time parameter of first method Calendar cal = new Calendar(); GameObject gameObject = new GameObject(); cal.AddEvent(2, gameObject, EventType.goDown); cal.AddEvent(3, gameObject, EventType.goDown); Event ev = cal.First(2); Assert.That(ev != null && ev.who == gameObject && ev.when == 2); }
public void CalendarFirstMethod_test_5() { Calendar cal = new Calendar(); GameObject gameObject = new GameObject(); cal.AddEvent(2, gameObject, EventType.goDown); cal.AddEvent(2, gameObject, EventType.goDown); Event ev = cal.First(2); Assert.That(cal.CountOfEvents == 1); ev = cal.First(2); Assert.That(cal.CountOfEvents == 0); }
public void CalendarFirstMethod_test_6() { Calendar cal = new Calendar(); GameObject gameObject = new GameObject(); cal.IsEnabledAddingEvents = false; cal.AddEvent(2, gameObject, EventType.goDown); Assert.That(cal.CountOfEvents == 0); }
public void CalendarFirstMethod_test_3() { Calendar cal = new Calendar(); GameObject gameObject = new GameObject(); cal.AddEvent(2, gameObject, EventType.goDown); Event ev = cal.First(1); Assert.That(ev == null); // no event is supposed to be returned }
public void CalendarFirstMethod_test_1() { Calendar cal = new Calendar(); GameObject gameObject = new GameObject(); cal.AddEvent(1, gameObject, EventType.goDown); Event ev = cal.First(2); Assert.That(ev != null && ev.who == gameObject && ev.when == 1); }
// AAA paradigm, encapsulate your function under test in a method with the meaningful name "Act" private void Act(CalendarEvent calendarEvent) { _calendar.AddEvent(calendarEvent); }