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"))); }
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"))); }
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); } }
public void SkipIncorrectSlides() { var dict = My_ParsingTask.ParseSlideRecords(new[] { slidesHeaderLine, "asd;asd;asd" }); Assert.That(dict, Is.Empty); }
public void ParseEmptySlides() { var dict = My_ParsingTask.ParseSlideRecords(new[] { slidesHeaderLine }); Assert.That(dict, Is.Empty); }