コード例 #1
0
ファイル: HamlLineLexer_Tests.cs プロジェクト: hobdrive/NHaml
        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));
        }
コード例 #2
0
ファイル: HamlFileLexer.cs プロジェクト: parhelia512/NHaml
 public HamlFileLexer()
 {
     _lineLexer = new HamlLineLexer();
 }
コード例 #3
0
ファイル: HamlLineLexer_Tests.cs プロジェクト: hobdrive/NHaml
 public void Constructor_CalculatesIndentCorrectly(string testString, string expectedIndent)
 {
     var line = new HamlLineLexer().ParseHamlLine(testString, 0);
     Assert.AreEqual(expectedIndent, line.First().Indent);
 }
コード例 #4
0
ファイル: HamlFileLexer.cs プロジェクト: hobdrive/NHaml
 public HamlFileLexer()
 {
     _lineLexer = new HamlLineLexer();
 }