public void CloneTest() { var exp = new NOr(new Bool(true), new Bool(false)); var clone = exp.Clone(); Assert.Equal(exp, clone); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns>The result of analysis.</returns> public string Analyze(NOr exp) { if (exp.Parent is BinaryExpression) { return(ToString(exp, "({0} nor {1})")); } return(ToString(exp, "{0} nor {1}")); }
/// <summary> /// Analyzes the specified expression. /// </summary> /// <param name="exp">The expression.</param> /// <returns> /// The result of analysis. /// </returns> /// <exception cref="System.NotSupportedException">Always.</exception> public virtual TResult Analyze(NOr exp) { throw new NotSupportedException(); }
public void NOrToStringTest1() { var eq = new NOr(new Bool(true), new Bool(false)); Assert.Equal("True nor False", eq.ToString(commoonFormatter)); }
public void ExecuteResultIsNotSupported() { var exp = new NOr(new Number(1), new Number(2)); Assert.Throws <ResultIsNotSupportedException>(() => exp.Execute()); }
public void TestNOrException() { var exp = new NOr(new ComplexNumber(1, 2), new ComplexNumber(2, 3)); TestException(exp); }
public void ExecuteTest2() { var nor = new NOr(new Bool(false), new Bool(false)); Assert.True((bool)nor.Execute()); }
public void TestNOrComplexBoolException() { var exp = new NOr(new ComplexNumber(1, 1), new Bool(false)); TestBinaryException(exp); }
public void TestNOrBoolComplexException() { var exp = new NOr(new Bool(true), new ComplexNumber(1, 1)); TestBinaryException(exp); }
public void TestNOrBoolean() { var exp = new NOr(new Bool(true), new Bool(false)); Test(exp, ResultType.Boolean); }
public void TestNOrUndefined() { var exp = new NOr(Variable.X, new Variable("y")); Test(exp, ResultType.Undefined); }
public void ExecuteTest2() { var nor = new NOr(new Bool(false), new Bool(false)); Assert.Equal(true, nor.Execute()); }