Esempio n. 1
0
        public void PublicDepth_SetDepth_OnlyCompareToThatDepth()
        {
            //  #   Arrange.
            var equal = Dto.CreatePair(
                _pr,
                new[] { Dto.Pair.Equal, Dto.Pair.Equal, Dto.Pair.Differs });
            var notEqual = Dto.CreatePair(
                _pr,
                new[] { Dto.Pair.Equal, Dto.Pair.Differs, Dto.Pair.Equal });

            //  #   Act.
            var res1 = AreEqual.Public((AreEqual.Depth) 2, equal.Item1, equal.Item2);
            var res2 = AreEqual.Public((AreEqual.Depth) 2, notEqual.Item1, notEqual.Item2);

            //  #   Assert.
            Assert.IsTrue(res1);
            Assert.IsFalse(res2);
        }
Esempio n. 2
0
        public void PublicDepth_InfiniteDepth_StopForNothing()
        {
            //  #   Arrange.
            var equal = Dto.CreatePair(
                _pr,
                CreateInfiniteEqualsList(Dto.Pair.Equal));
            var notEqual = Dto.CreatePair(
                _pr,
                CreateInfiniteEqualsList(Dto.Pair.Differs));

            //  #   Act.
            var res1 = AreEqual.Public(AreEqual.Depth.Infinite, equal.Item1, equal.Item2);
            var res2 = AreEqual.Public(AreEqual.Depth.Infinite, notEqual.Item1, notEqual.Item2);

            //  #   Assert.
            Assert.IsTrue(res1);
            Assert.IsFalse(res2);
        }
Esempio n. 3
0
        public void PublicDepth_NoDepth_OnlyCompareImmediateObject()
        {
            //  #   Arrange.
            var equal = Dto.CreatePair(
                _pr,
                new[] { Dto.Pair.Equal, Dto.Pair.Differs });
            var notEqual = Dto.CreatePair(
                _pr,
                new[] { Dto.Pair.Differs, Dto.Pair.Equal });

            //  #   Act.
            var res1 = AreEqual.Public(AreEqual.Depth.None, equal.Item1, equal.Item2);
            var res2 = AreEqual.Public(AreEqual.Depth.None, notEqual.Item1, notEqual.Item2);

            //  #   Assert.
            Assert.IsTrue(res1);
            Assert.IsFalse(res2);
        }