/// <summary> /// Two DnsAddressPrefix are equal iff their address family, prefix length, negation and address family dependent part are equal. /// </summary> public bool Equals(DnsAddressPrefix other) { return(other != null && AddressFamily.Equals(other.AddressFamily) && PrefixLength.Equals(other.PrefixLength) && Negation.Equals(other.Negation) && AddressFamilyDependentPart.Equals(other.AddressFamilyDependentPart)); }
public static void UnaryOperationsAreNotEqualToNull() { var op = new Negation(One); Assert.False(op.Equals(null)); Assert.False(op == null); Assert.False(null == op); }
public static void UnaryOperationsAreEquatable() { var op1 = new Negation(One); var op2 = new Negation(One); Assert.True(op1.Equals(op2)); Assert.True(op1 == op2); }
public static void BinaryOperationsCanCompareToUnaryOperations() { var op1 = new Addition(Numbers.One, Numbers.One); var op2 = new Negation(Numbers.Two); Assert.False(op1 == op2); Assert.False(op2 == op1); Assert.False(op1.Equals(op2)); Assert.False(op2.Equals(op1)); }