public void TestSettingOfPrefix() { var model = new TagModel(new Hashtable()); var tag = new Bundle(); tag.BaseName = new MockAttribute(new Constant("FormatTags/test")); tag.Prefix = new MockAttribute(new Constant("pre_")); Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty)); var bundle = (ResourceBundle) model.SearchInTagScope(FormatConstants.BUNDLE); Assert.That(bundle.Prefix, Is.EqualTo("pre_")); }
public void CheckLoadingOfBundle() { var model = new TagModel(new Hashtable()); var tag = new Bundle(); tag.BaseName = new MockAttribute(new Constant("FormatTags/test")); Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty)); Assert.That(model.SearchInTagScope(FormatConstants.BUNDLE), Is.Not.Null); Assert.That(model.SearchInTagScope(FormatConstants.BUNDLE) is ResourceBundle, Is.True); var bundle = (ResourceBundle) model.SearchInTagScope(FormatConstants.BUNDLE); Assert.That(bundle.BaseName, Is.EqualTo("FormatTags/test")); }
public void CheckRequired() { var tag = new Bundle(); try { RequiredAttribute.Check(tag); Assert.Fail("Expected Exception"); } catch (TagException Te) { Assert.That(Te.Message, Is.EqualTo(TagException.MissingRequiredAttribute(typeof (Bundle), "BaseName").Message)); } tag.BaseName = new MockAttribute(new Constant("a")); RequiredAttribute.Check(tag); }