Esempio n. 1
0
 public void LoadingPartialInsideNamedSection()
 {
     var viewFolder = new InMemoryViewFolder
                          {
                              {Path.Combine("home", "index.spark"), "<for each='var x in new[]{1,2,3}'><Guts><section:foo><Another/></section:foo></Guts></for>"},
                              {Path.Combine("home", "_Guts.spark"), "<div><render:foo/></div>"},
                              {Path.Combine("home", "_Another.spark"), "<p>hello world</p>"}
                          };
     var viewLoader = new ViewLoader { SyntaxProvider = new DefaultSyntaxProvider(ParserSettings.DefaultBehavior), ViewFolder = viewFolder };
     var chunks = viewLoader.Load(Path.Combine("home", "index.spark"));
     var everything = viewLoader.GetEverythingLoaded();
     Assert.AreEqual(3, everything.Count());
 }
Esempio n. 2
0
 public void LoadingEmptyShadeFile()
 {
     var viewFolder = new InMemoryViewFolder
     {
         {Path.Combine("home", "empty.shade"), ""},
     };
     var viewLoader = new ViewLoader { SyntaxProvider = new DefaultSyntaxProvider(ParserSettings.DefaultBehavior), ViewFolder = viewFolder };
     var chunks = viewLoader.Load(Path.Combine("home", "empty.shade"));
     var everything = viewLoader.GetEverythingLoaded();
     Assert.AreEqual(1, everything.Count());
 }