Example #1
0
        public void ValueDifferenceGivesDetailsOnFailureWithShorterEnums()
        {
            var result = EqualityHelper.ValueDifference(new List <List <int> > {
                this.a
            }, "a", this.list);

            Check.That(result[0].FirstName).IsEqualTo("a[1]");
            result = EqualityHelper.ValueDifference(this.list, "a", new List <List <int> > {
                this.a
            });
            Check.That(result[0].FirstName).IsEqualTo("a[1]");
        }
Example #2
0
        public void ValueDifferenceGivesDetailsOnFailure()
        {
            // List contains new instances of lists same as a and b

            var result = EqualityHelper.ValueDifference(this.a, "a", this.b);

            Check.That(result.GetCount()).IsEqualTo(2);
            Check.That(result[0].FirstName).IsEqualTo("a[0]");
            Check.That(result[0].FirstValue).IsEqualTo(1);
            Check.That(result[0].SecondValue).IsEqualTo(3);

            result = EqualityHelper.ValueDifference(this.a, "a", this.a);
            Check.That(result.GetCount()).IsEqualTo(0);

            result = EqualityHelper.ValueDifference(this.list, "a", new List <List <int> > {
                this.a, this.a
            });
            Check.That(result[0].FirstName).IsEqualTo("a[1][0]");
        }
Example #3
0
        public void ValueDifferenceGivesDetailsOnFailure()
        {
            // List contains new instances of lists same as a and b

            var result = EqualityHelper.ValueDifference(a, "a", b, "b");

            Check.That(result).HasSize(2);
            Check.That(result[0].FirstName).IsEqualTo("a[0]");
            Check.That(result[0].SecondName).IsEqualTo("b[0]");
            Check.That(result[0].FirstValue).IsEqualTo(1);
            Check.That(result[0].SecondValue).IsEqualTo(3);

            result = EqualityHelper.ValueDifference(a, "a", a, "a");
            Check.That(result).HasSize(0);

            result = EqualityHelper.ValueDifference(this.list, "a", new List <List <int> > {
                a, a
            }, "b");
            Check.That(result[0].FirstName).IsEqualTo("a[1][0]");
        }
Example #4
0
        public void ValueDifferenceReturnsEmptyIfEqual()
        {
            var result = EqualityHelper.ValueDifference(this.a, "a", this.a);

            Check.That(result.GetCount()).IsEqualTo(0);
        }
Example #5
0
        public void ValueDifferenceReturnsEmptyIfEqual()
        {
            var result = EqualityHelper.ValueDifference(a, "a", a, "a");

            Check.That(result).HasSize(0);
        }