public void TestSelfClosing() { HamlGenerator parser = new HamlGenerator(); TextReader input = new StringReader("%img{src=\"bild\",border=\"1\"}"); parser.Parse(input); StringWriter output = new StringWriter(new StringBuilder()); parser.GenerateCode(output); Assert.Equal("sb.Append(@\"<img src=\"\"bild\"\" border=\"\"1\"\"/>\");", output.ToString()); }
protected static string Parse(string text) { HamlGenerator parser = new HamlGenerator(); TextReader input = new StringReader(text); parser.Parse(input); StringBuilder sb = new StringBuilder(); TextWriter output = new StringWriter(sb); parser.GenerateCode(output); return output.ToString(); }