Пример #1
0
        public void VariableTrueDifferentPageScope()
        {
            var session = new MockSessionState();
            var model = new TagModel(this, session);

            var tag = new If();
            tag.Body = new MockAttribute(new Property("Body"));
            tag.Test = new MockAttribute(new Property("True"));
            tag.Var = new MockAttribute(new Property("VarName"));
            tag.Scope = new MockAttribute(new Property("SessionScope"));
            Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
            Assert.That(model.Session[VarName], Is.EqualTo(Body));
        }
Пример #2
0
 public void SimpleFalse()
 {
     var tag = new If();
     tag.Body = new MockAttribute(new Property("Body"));
     tag.Test = new MockAttribute(new Property("False"));
     Assert.That(tag.Evaluate(new TagModel(this)), Is.EqualTo(String.Empty));
 }
Пример #3
0
 public void VariableTrue()
 {
     var model = new TagModel(this);
     var tag = new If();
     tag.Body = new MockAttribute(new Property("Body"));
     tag.Test = new MockAttribute(new Property("True"));
     tag.Var = new MockAttribute(new Property("VarName"));
     Assert.That(tag.Evaluate(model), Is.EqualTo(String.Empty));
     Assert.That(model[VarName], Is.EqualTo(Body));
 }