Compare() public method

Compares the expected to the actual event.
public Compare ( object expected, object actual ) : IEnumerable
expected object The expected event.
actual object The actual event.
return IEnumerable
Example #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);
        }
Example #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));
        }