public void AtLeastOneFileSectionExists() { var result = ParseSampleLesson(); LessonFile fileSection = null; foreach (var step in result.Document.Steps) { foreach (var c in step.Children) { if (c is LessonFile) { return; } } } Assert.Fail("No FILE section exists"); }
private LessonFile ParseFile(StringWithIndex text) { text = text.Trim(); var file = new LessonFile(text); var parts = text.SplitAfterFirstLine(); // Parse the title var titlePart = parts[0]; file.Children.Add(new LessonFileMethodReference(titlePart)); var codePart = parts[1]; file.Children.Add(new LessonCode(codePart)); return(file); }