public void OperateTwoTest() { Variable p = new Variable('p'); Variable q = new Variable('q'); BiImplication a = new BiImplication(); a.Operate(p, q); Assert.AreEqual(p, a.Childs[0]); Assert.AreEqual(q, a.Childs[1]); Assert.ThrowsException <ArgumentNullException>(() => a.Operate(null, null)); }
public void ToStringTest() { Variable p = new Variable('p'); Variable q = new Variable('q'); BiImplication a = new BiImplication(p, q); Assert.AreEqual("(p = q)", a.ToString()); Not Left = new Not(p); Or Right = new Or(p, q); a.Operate(Left, Right); Assert.AreEqual("(~p = (p | q))", a.ToString()); Left = new Not(new Nand(p, q)); a.Operate(Left, Right); Assert.AreEqual("(~(p % q) = (p | q))", a.ToString()); }
public void OperateListTest() { List <Variable> vars = new List <Variable>() { new Variable('p'), new Variable('q') }; BiImplication a = new BiImplication(); a.Operate(vars); Assert.AreEqual(vars[0], a.Childs[0]); Assert.AreEqual(vars[1], a.Childs[1]); }