Compares results using a ICompareObjects object and reports the differences.
Inheritance: IResultComparer
Exemple #1
0
        public void CompareReturnsExpectedResultWhenObjectsAreEqual()
        {
            var comparer = new CompareLogic();
            var sut      = new CompareNetObjectsBasedResultComparer(comparer);

            const int expected = 1;
            const int actual   = 1;
            var       result   = sut.Compare(expected, actual);

            Assert.That(result, Is.Empty);
        }
Exemple #2
0
        public void CompareReturnsExpectedResultWhenObjectsDiffer()
        {
            var comparer = new CompareLogic();
            var sut      = new CompareNetObjectsBasedResultComparer(comparer);

            const int expected = 1;
            const int actual   = 2;
            var       result   = sut.Compare(expected, actual);

            Assert.That(result,
                        Is.EquivalentTo(new[]
            {
                new ResultComparisonDifference(expected, actual, "Types [Int32,Int32], Item Expected != Actual, Values (1,2)")
            }).Using(ResultComparisonDifferenceComparer.Instance));
        }
Exemple #3
0
        public void IsResultComparer()
        {
            var sut = new CompareNetObjectsBasedResultComparer(new CompareLogic());

            Assert.IsInstanceOf <IResultComparer>(sut);
        }