Ejemplo n.º 1
0
 public void TestSimpleGeneration()
 {
     TokenTree toGenerate = new TokenTree
     {
         Key = new StringToken(""),
         Children =
         {
             new TokenTree
             {
                 Key = new StringToken("Fields"),
                 Children =
                 {
                     new TokenTree
                     {
                         Key = new StringToken("Field"),
                         Value = new StringToken("Grid"),
                         Children =
                         {
                             new TokenTree
                             {
                                 Key = new StringToken("Field"),
                                 Value = new StringToken("Label"),
                                 Children =
                                 {
                                     new TokenTree {Key = new StringToken("Content"), Value = new StringToken("Hi")},
                                     new TokenTree {Key = new StringToken("Width"), Value = new StringToken("200")}
                                 }
                             }
                         }
                     }
                 }
             }
         }
     };
     string generated = new XamlGenerator().GenerateXaml(toGenerate);
     Assert.AreEqual(XAML.Replace(" ", ""), generated.Replace(" ", "").Replace(Environment.NewLine, ""));
 }
Ejemplo n.º 2
0
 public void TestVTL()
 {
     TokenTree tokenTree = Parser.ParseString(VTL);
     string generated = new XamlGenerator().GenerateXaml(tokenTree);
     Assert.AreEqual(XAML.Replace(" ", ""), generated.Replace(" ", "").Replace(Environment.NewLine, ""));
 }