Пример #1
0
 public void BoundaryTest_GetLeafs()
 {
     EventComponent e = new EventComposite("t","d",ole);
     Assert.AreEqual(true, e.GetLeafs().Length == 0);
     Assert.AreEqual(true, Event4.GetLeafs().Length == 0);
     Assert.AreEqual(true, Event5.GetLeafs().Length == 5);
 }
Пример #2
0
        public void SetUp()
        {
            kim = new Account("Kim", "Kim", "[email protected]", false);
            ole = new Account("Ole", "Ole", "[email protected]", false);
            pia = new Account("Pia", "Pia", "[email protected]", false);

            EventComponent[] events = new EventComponent[5];
            events[0] = new EventLeaf("Event1", "A description", DateTime.Parse("11-11-11"), DateTime.Parse("11-11-12"), kim, new Account[] { }, new INotification[] { });
            events[1] = new EventLeaf("", "", DateTime.Parse("11-11-10"), DateTime.Parse("11-11-11"), ole, new[] { kim}, new INotification[] { new Notification(DateTime.Parse("11-11-9"), false)});
            events[2] = new EventLeaf("Event3", "A description", DateTime.Parse("11-11-11"), DateTime.Parse("11-11-12"), kim, new[] { kim, ole}, new INotification[] { });
            events[3] = new EventLeaf("Event4", "A description", DateTime.Parse("11-11-11"), DateTime.Parse("11-11-12"), ole, new[] { kim, ole, pia }, new INotification[] { });
            events[4] = new EventLeaf("Event5", "A description", DateTime.Parse("11-11-9"), DateTime.Parse("11-11-13"), pia, new Account[] { }, new INotification[] { new Notification(DateTime.Parse("11-11-9"), false)});

            Event1 = events[0];
            Event2 = events[1];

            EventComposite e1 = new EventComposite("Compo1", "A grup description",kim, new IAccount[0]);
            e1.eventComponents = new EventComponent[] {events[0], events[1]};
            Event3 = e1;

            EventComposite e2 = new EventComposite("Compo2", "A grup description", ole, new IAccount[0]);
            e2.eventComponents = new EventComponent[] {};
            Event4 = e2;

            EventComposite e3 = new EventComposite("Compo3", "A grup description", kim, new IAccount[0]);
            e3.eventComponents = new EventComponent[] { events[0], events[1], events[2], events[3], events[4] };
            Event5 = e3;

            EventComposite e4 = new EventComposite("Compo4", "A grup description2", pia, new IAccount[0]);
            e4.eventComponents = new EventComponent[] { e1, e3 };
            Event6 = e4;
        }
Пример #3
0
 public void GetLeafs_BoundaryTest()
 {
     EventComponent e = new EventComposite("t", "d", ole, new IAccount[0]);
     Assert.AreEqual(true, e.GetLeafs().Length == 0);
     Assert.AreEqual(true, Event4.GetLeafs().Length == 0);
     Assert.AreEqual(true, Event5.GetLeafs().Length == 5);
 }