Beispiel #1
0
        public void X_EqualsTo_Y()
        {
            // generic
            Assert.IsTrue(1.EqualsTo(1));
            Assert.IsFalse(2.EqualsTo(1));

            //specialized
            var e1 = new Equatable(1);
            var e2 = new Equatable(2);

            Assert.IsFalse(e1.EqualsTo(e2));
            Assert.IsTrue(e1.EqualsTo(e1));
        }
Beispiel #2
0
        public void Xs_EqualsTo_Ys()
        {
            var array1 = new[] { 1, 2, 3 };
            var array2 = new[] { 1, 2, 4 };

            Assert.IsTrue(array1.EqualsTo(array1));
            Assert.IsFalse(array1.EqualsTo(array2));

            // specialized
            var e1 = new Equatable(1);
            var e2 = new Equatable(2);
            var a1 = new[] { e1, e2 };
            var a2 = new[] { e1, e1 };

            Assert.IsTrue(a1.EqualsTo(a1));
            Assert.IsFalse(a1.EqualsTo(a2));
        }