public void Equals() { CallExpression expr1 = new CallExpression("puts", new IExpression[] { new ConstantExpression(1) }); CallExpression expr2 = new CallExpression("put", new IExpression[] { new ConstantExpression(1) }); CallExpression expr3 = new CallExpression("puts", new IExpression[] { new ConstantExpression(2) }); CallExpression expr4 = new CallExpression("puts", new IExpression[] { new ConstantExpression(2), new ConstantExpression(3) }); CallExpression expr5 = new CallExpression("puts", new IExpression[] { new ConstantExpression(1) }); Assert.IsTrue(expr1.Equals(expr5)); Assert.IsTrue(expr5.Equals(expr1)); Assert.AreEqual(expr1.GetHashCode(), expr5.GetHashCode()); Assert.IsFalse(expr1.Equals(null)); Assert.IsFalse(expr1.Equals(123)); Assert.IsFalse(expr1.Equals(expr2)); Assert.IsFalse(expr2.Equals(expr1)); Assert.IsFalse(expr1.Equals(expr3)); Assert.IsFalse(expr3.Equals(expr1)); Assert.IsFalse(expr1.Equals(expr4)); Assert.IsFalse(expr4.Equals(expr1)); }