public void fastAssertSingleReplacementDiffEnsuresOldHaystackDoesNotContainNeedle() { const string OLD_HAYSTACK = "abc"; const string NEW_HAYSTACK = "abcd"; const string NEEDLE = "b"; Assert.Throws <DoesNotContainException>(() => FastAssert.fastAssertSingleReplacementDiff(OLD_HAYSTACK, NEW_HAYSTACK, NEEDLE)); }
public void fastAssertSingleReplacementDiffDoesNotThrowWhenNeedleIsFound() { const string OLD_HAYSTACK = "abc"; const string NEW_HAYSTACK = "adc"; const string NEEDLE = "d"; FastAssert.fastAssertSingleReplacementDiff(OLD_HAYSTACK, NEW_HAYSTACK, NEEDLE); }
public void fastAssertSingleReplacementDiffEnsuresOldAndNewHaystacksAreDifferent() { const string OLD_HAYSTACK = "abc"; const string NEW_HAYSTACK = "abc"; const string NEEDLE = "d"; Assert.Throws <FalseException>(() => FastAssert.fastAssertSingleReplacementDiff(OLD_HAYSTACK, NEW_HAYSTACK, NEEDLE)); }
public void fastAssertSingleReplacementDiffShowsDiffWhenNeedleIsNotFound() { const string OLD_HAYSTACK = "abc"; const string NEW_HAYSTACK = "adc"; const string NEEDLE = "e"; try { FastAssert.fastAssertSingleReplacementDiff(OLD_HAYSTACK, NEW_HAYSTACK, NEEDLE); Assert.False(true, "should have thrown a ContainsException above"); } catch (XunitException e) { Assert.Equal("Not found:\ne\n\nIn actual. Diff between original and actual:\nadc", e.Message); } }