public void CompareReturnsExpectedExceptionWhenObjectsAreEqual() { var comparer = new CompareObjects(); var sut = new CompareNetObjectsBasedExceptionComparer(comparer); var expected = new Exception("1"); var actual = new Exception("1"); var result = sut.Compare(expected, actual); Assert.That(result, Is.Empty); }
public void CompareReturnsExpectedExceptionWhenObjectsDiffer() { var comparer = new CompareObjects(); var sut = new CompareNetObjectsBasedExceptionComparer(comparer); var expected = new Exception("1"); var actual = new Exception("2"); var result = sut.Compare(expected, actual); Assert.That(result, Is.EquivalentTo(new[] { new ExceptionComparisonDifference(expected, actual, "Expected..Message != Actual..Message (1,2)") }).Using(ExceptionComparisonDifferenceComparer.Instance)); }
public void IsExceptionComparer() { var sut = new CompareNetObjectsBasedExceptionComparer(new CompareLogic()); Assert.IsInstanceOf <IExceptionComparer>(sut); }