Ejemplo n.º 1
0
 /// <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));
 }
Ejemplo n.º 2
0
        public static void UnaryOperationsAreNotEqualToNull()
        {
            var op = new Negation(One);

            Assert.False(op.Equals(null));
            Assert.False(op == null);
            Assert.False(null == op);
        }
Ejemplo n.º 3
0
        public static void UnaryOperationsAreEquatable()
        {
            var op1 = new Negation(One);
            var op2 = new Negation(One);

            Assert.True(op1.Equals(op2));
            Assert.True(op1 == op2);
        }
Ejemplo n.º 4
0
        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));
        }