예제 #1
0
        public void ParseSingleSlide()
        {
            var dict = My_ParsingTask.ParseSlideRecords(new[] { slidesHeaderLine, "42;exercise;title" });

            Assert.That(dict, Has.Count.EqualTo(1));
            Assert.That(dict[42], Is.EqualTo(new SlideRecord(42, SlideType.Exercise, "title")));
        }
예제 #2
0
        public void ParseSeveralSlides()
        {
            var dict =
                My_ParsingTask.ParseSlideRecords(new[] { slidesHeaderLine, "42;exercise;title", "1;quiz;title2" });

            Assert.That(dict, Has.Count.EqualTo(2));
            Assert.That(dict[42], Is.EqualTo(new SlideRecord(42, SlideType.Exercise, "title")));
            Assert.That(dict[1], Is.EqualTo(new SlideRecord(1, SlideType.Quiz, "title2")));
        }
예제 #3
0
        private static void Main()
        {
            var encoding     = Encoding.GetEncoding(1251);
            var slideRecords = My_ParsingTask.ParseSlideRecords(File.ReadAllLines("slides.txt", encoding));
            var visitRecords = My_ParsingTask.ParseVisitRecords(File.ReadAllLines("visits.txt", encoding), slideRecords).ToList();

            foreach (var slideType in new[] { SlideType.Theory, SlideType.Exercise, SlideType.Quiz })
            {
                var time = My_StatisticsTask.GetMedianTimePerSlide(visitRecords, slideType);
                Console.WriteLine("Median time per slide '{0}': {1} mins", slideType, time);
            }
        }
예제 #4
0
        public void SkipIncorrectSlides()
        {
            var dict = My_ParsingTask.ParseSlideRecords(new[] { slidesHeaderLine, "asd;asd;asd" });

            Assert.That(dict, Is.Empty);
        }
예제 #5
0
        public void ParseEmptySlides()
        {
            var dict = My_ParsingTask.ParseSlideRecords(new[] { slidesHeaderLine });

            Assert.That(dict, Is.Empty);
        }