Ejemplo n.º 1
0
        public void Test_ScheduledEvents()
        {
            Interval[] events1 = new Interval[] {
                new Interval()
                {
                    start = 1, end = 4
                },
                new Interval()
                {
                    start = 12, end = 15
                },
                new Interval()
                {
                    start = 5, end = 8
                },
                new Interval()
                {
                    start = 9, end = 10
                },
                new Interval()
                {
                    start = 2, end = 7
                },
                new Interval()
                {
                    start = 9, end = 11
                },
            };

            SortingAlgorithms algo = new SortingAlgorithms();

            List <Interval> listEvents = new List <Interval>(events1);

            Assert.AreEqual(2, algo.MaxScheduledEvents(listEvents));

            listEvents.Add(
                new Interval()
            {
                start = 6, end = 11
            }
                );

            Assert.AreEqual(3, algo.MaxScheduledEvents(listEvents));
        }
Ejemplo n.º 2
0
        public void Test_ScheduledEvents()
        {
            Interval[] events1 = new Interval[] {
                new Interval() { start = 1, end = 4  },
                new Interval() { start = 12, end = 15  },
                new Interval() { start = 5, end = 8  },
                new Interval() { start = 9, end = 10  },
                new Interval() { start = 2, end = 7  },
                new Interval() { start = 9, end = 11  },
            };

            SortingAlgorithms algo = new SortingAlgorithms();

            List < Interval > listEvents = new List<Interval>(events1);
            Assert.AreEqual(2, algo.MaxScheduledEvents(listEvents));

            listEvents.Add(
                new Interval() { start = 6, end = 11 }
                );

            Assert.AreEqual(3, algo.MaxScheduledEvents(listEvents));
        }