public void DefaultValues() { var sut = new InvocationExpression(); Assert.AreEqual(new VariableReference(), sut.Reference); Assert.AreEqual(Names.UnknownMethod, sut.MethodName); Assert.AreEqual(Lists.NewList <ISimpleExpression>(), sut.Parameters); Assert.AreNotEqual(0, sut.GetHashCode()); Assert.AreNotEqual(1, sut.GetHashCode()); }
public void Equality_Default() { var a = new InvocationExpression(); var b = new InvocationExpression(); Assert.AreEqual(a, b); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentMethod() { var a = new InvocationExpression { MethodName = GetMethod("A") }; var b = new InvocationExpression { MethodName = GetMethod("B") }; Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentParameters() { var a = new InvocationExpression { Parameters = RefExprs("a") }; var b = new InvocationExpression { Parameters = RefExprs("b") }; Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }
public void Equality_DifferentReference() { var a = new InvocationExpression { Reference = new VariableReference { Identifier = "a" } }; var b = new InvocationExpression { Reference = new VariableReference { Identifier = "b" } }; Assert.AreNotEqual(a, b); Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode()); }