public void Constructor_InlineContent_GeneratesCorrectLines( string templateLine, string expectedLine1, string expectedLine2) { var lines = new HamlLineLexer().ParseHamlLine(templateLine, 0).ToList(); int expectedLineCount = expectedLine2 == null ? 1 : 2; Assert.That(lines.Count, Is.EqualTo(expectedLineCount)); Assert.That(lines[0].Content, Is.EqualTo(expectedLine1)); if (expectedLineCount > 1) Assert.That(lines[1].Content, Is.EqualTo(expectedLine2)); }
public HamlFileLexer() { _lineLexer = new HamlLineLexer(); }
public void Constructor_CalculatesIndentCorrectly(string testString, string expectedIndent) { var line = new HamlLineLexer().ParseHamlLine(testString, 0); Assert.AreEqual(expectedIndent, line.First().Indent); }