Example #1
0
        public void Test_OneType_Equality()
        {
            var empty = new One <int>();
            var zero  = new One <int>(0);
            var one   = new One <int>(1);

            var empty2 = new One <int>();
            var zero2  = new One <int>(0);
            var one2   = new One <int>(1);

            empty.Equals(empty2).ShouldBeTrue();
            empty.Equals(zero).ShouldBeFalse();
            empty.Equals(0).ShouldBeFalse();
            empty.Equals(one).ShouldBeFalse();
            empty.Equals(1).ShouldBeFalse();

            zero.Equals(empty).ShouldBeFalse();
            zero.Equals(zero2).ShouldBeTrue();
            zero.Equals(0).ShouldBeTrue();
            zero.Equals(one).ShouldBeFalse();
            zero.Equals(1).ShouldBeFalse();

            one.Equals(empty).ShouldBeFalse();
            one.Equals(zero).ShouldBeFalse();
            one.Equals(0).ShouldBeFalse();
            one.Equals(one2).ShouldBeTrue();
            one.Equals(1).ShouldBeTrue();
        }
 public bool Equals(WaymarkPreset other)
 {
     return(A.Equals(other.A) &&
            B.Equals(other.B) &&
            C.Equals(other.C) &&
            D.Equals(other.D) &&
            One.Equals(other.One) &&
            Two.Equals(other.Two) &&
            Three.Equals(other.Three) &&
            Four.Equals(other.Four) &&
            MapID == other.MapID);
 }
Example #3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is LoyaltyProgramTerminology other &&
                   ((One == null && other.One == null) || (One?.Equals(other.One) == true)) &&
                   ((Other == null && other.Other == null) || (Other?.Equals(other.Other) == true)));
        }