public void Evaluate() { ParserContext pc = new ParserContext(ParserContext.DefaultBufferSize); FormatterContext fc = new FormatterContext(FormatterContext.DefaultBufferSize); ConditionalOrOperator op = new ConditionalOrOperator( new MockBooleanExpression(true), new MockBooleanExpression(true)); Assert.IsTrue(op.EvaluateParse(ref pc)); Assert.IsTrue(op.EvaluateFormat(new StringField(3, "000000"), ref fc)); op = new ConditionalOrOperator( new MockBooleanExpression(false), new MockBooleanExpression(true)); Assert.IsTrue(op.EvaluateParse(ref pc)); Assert.IsTrue(op.EvaluateFormat(new StringField(3, "000000"), ref fc)); op = new ConditionalOrOperator( new MockBooleanExpression(true), new MockBooleanExpression(false)); Assert.IsTrue(op.EvaluateParse(ref pc)); Assert.IsTrue(op.EvaluateFormat(new StringField(3, "000000"), ref fc)); op = new ConditionalOrOperator( new MockBooleanExpression(false), new MockBooleanExpression(false)); Assert.IsFalse(op.EvaluateParse(ref pc)); Assert.IsFalse(op.EvaluateFormat(new StringField(3, "000000"), ref fc)); }
public void InstantiationAndProperties() { ConditionalOrOperator op = new ConditionalOrOperator(); Assert.IsNull(op.LeftExpression); Assert.IsNull(op.RightExpression); MockBooleanExpression left = new MockBooleanExpression(true); MockBooleanExpression right = new MockBooleanExpression(true); op = new ConditionalOrOperator(left, right); Assert.IsTrue(op.LeftExpression == left); Assert.IsTrue(op.RightExpression == right); op.LeftExpression = null; op.RightExpression = null; Assert.IsNull(op.LeftExpression); Assert.IsNull(op.RightExpression); }