Esempio n. 1
0
 public void CheckLoadingOfSetBundle()
 {
     var model = new TagModel(new Hashtable());
     var tag = new SetBundle();
     tag.BaseName = new MockAttribute(new Constant("FormatTags/test"));
     tag.Var = new MockAttribute(new Constant("myBundle"));
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     Assert.That(model.Page["myBundle"], Is.Not.Null);
     Assert.That(model.Page["myBundle"] is ResourceBundle, Is.True);
     var bundle = (ResourceBundle) model.Page["myBundle"];
     Assert.That(bundle.BaseName, Is.EqualTo("FormatTags/test"));
 }
Esempio n. 2
0
 public void TestSettingOfScope()
 {
     var model = new TagModel(new Hashtable(), new MockSessionState());
     var tag = new SetBundle();
     tag.BaseName = new MockAttribute(new Constant("FormatTags/test"));
     tag.Var = new MockAttribute(new Constant("myBundle"));
     tag.Scope = new MockAttribute(new Constant(VariableScope.Session.ToString()));
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     Assert.That(model.Page["myBundle"], Is.Null);
     Assert.That(model.Session["myBundle"], Is.Not.Null);
     Assert.That(model.Session["myBundle"] is ResourceBundle, Is.True);
     var bundle = (ResourceBundle) model.Session["myBundle"];
     Assert.That(bundle.BaseName, Is.EqualTo("FormatTags/test"));
 }