Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
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);
        }
Example #4
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
        }
Example #5
0
        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);
        }
Example #6
0
 // AAA paradigm, encapsulate your function under test in a method with the meaningful name "Act"
 private void Act(CalendarEvent calendarEvent)
 {
     _calendar.AddEvent(calendarEvent);
 }