コード例 #1
0
        public void Test_Correctness_1()
        {
            var input = new List <Slot>();

            input.AddRange(TestData.Default().FindAll(x => x.UID == 28)); //Lecture of BEAM
            input.AddRange(TestData.Default().FindAll(x => x.UID == 6));  //Lecture of BKA
            var result = new TimetableFinder().GetPossibleTimetables(input.ToArray());

            Assert.AreEqual(null, result);
        }
コード例 #2
0
        // [Ignore("Not testing this as TimetableFinder is not used in production code")]
        public void Test_TimetableFinder_UsingRunByWithoutConsideringWeekNumber()
        {
            int expectedCount          = 285696;
            List <List <Slot> > result = new List <List <Slot> >();

            Benchmark(() => {
                result =
                    new TimetableFinder().GetPossibleTimetables(input().ToArray());
            }, "TimetableFinder_WithoutConsideringWeekNumber");
            Assert.True(result.Count == expectedCount);
        }
コード例 #3
0
        public void Test_TimetableFinder_UsingRunByConsideringWeekNumber()
        {
            int expectedCount          = 616872;
            List <List <Slot> > result = new List <List <Slot> >();

            Benchmark(() => {
                result =
                    new TimetableFinder().GetPossibleTimetables(input().ToArray());
            }, "TimetableFinder_ConsideringWeekNumber");
            Assert.True(result.Count == expectedCount, $"Expected count is {expectedCount} but actual is {result.Count}");
        }
コード例 #4
0
        public void Test_TimetableFinder_SortBySlotCount_1()
        {
            var input          = GetInput();
            var subjects       = SubjectModel.Parse(input);
            var timtableFinder = new TimetableFinder();
            var result         = timtableFinder.SortBySlotCount(subjects);

            for (int i = 0; i < result.Count; i++)
            {
                Console.WriteLine(result[i].Code + " " + result[i].Slots.Count);
            }
        }
コード例 #5
0
        public void FullTest_1()
        {
            var data  = new HtmlSlotParser().Parse(Helper.RawStringOfTestFile("SampleData-FAM-2017-2ndSem.html"));
            var input = new List <Slot>();

            input.AddRange(data.FindAll(x => x.Code == "UKAF4023")); //ATP
            input.AddRange(data.FindAll(x => x.Code == "MPU34022")); //ACP
            input.AddRange(data.FindAll(x => x.Code == "MPU34032")); //CP
            input.AddRange(data.FindAll(x => x.Code == "UKAI3013")); //E
            var result = new TimetableFinder().GetPossibleTimetables(input.ToArray());

            Assert.AreEqual(112, result.Count);
        }