void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "someText".MustHaveLength(13, exception: exception))) .Add(new CustomMessageTest <StringException>(message => "foo".MustHaveLength(2, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "foo".MustBeSameAs("bar", exception: exception))) .Add(new CustomMessageTest <ArgumentException>(message => "foo".MustBeSameAs("bar", message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "Wow!".MustBeOfType <Stream>(exception: exception))) .Add(new CustomMessageTest <TypeMismatchException>(message => "Hello".MustBeOfType <StringBuilder>(message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => 42.MustNotBeLessThanOrEqualTo(42, exception: exception))); testData.Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => 42.MustNotBeLessThanOrEqualTo(42, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "a".MustNotBeOneOf(new[] { "a", "b", "c" }, exception: exception))) .Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => "a".MustNotBeOneOf(new[] { "a", "b", "c" }, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => 2.MustBeGreaterThanOrEqualTo(42, exception))) .Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => 30.MustBeGreaterThanOrEqualTo(31, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => new Uri("/api/buildings", UriKind.Relative).MustBeAbsoluteUri(exception))) .Add(new CustomMessageTest <RelativeUriException>(message => new Uri("/api/buildings", UriKind.Relative).MustBeAbsoluteUri(message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => 1.MustBeGreaterThan(2, exception: exception))) .Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => 42.MustBeGreaterThan(87, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "someText".MustNotBeSubstringOf("someText", exception: exception))) .Add(new CustomMessageTest <StringException>(message => "someText".MustNotBeSubstringOf("someText", message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => new[] { 1, 2 }.MustStartWith(new[] { 3 }, exception: exception))) .Add(new CustomMessageTest <CollectionException>(message => new[] { 1, 2 }.MustStartWith(new[] { 3 }, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => 'a'.MustBeOneOf(new[] { 'x', 'y' }, exception: exception))) .Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => 'x'.MustBeOneOf(new[] { 'a', 'b', 'c' }, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => true.MustBeFalse(exception: exception))) .Add(new CustomMessageTest <ArgumentException>(message => true.MustBeFalse(message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "!".MustContainOnlyLetters(exception: exception))) .Add(new CustomMessageTest <StringException>(message => "$".MustContainOnlyLetters(message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "Hello".MustBe("World", exception: exception))) .Add(new CustomMessageTest <ArgumentException>(message => 42.MustBe(48, message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "The Lord of Light wants his enemies burnt".MustEndWithEquivalentOf("One should treat others as one would like others to treat oneself", exception: exception))) .Add(new CustomMessageTest <StringException>(message => "The Drowned God wants his enemies drowned".MustEndWithEquivalentOf("altruism", message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => 30.MustNotBeIn(Range <int> .FromInclusive(30).ToExclusive(35), exception: exception))) .Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => 42.MustNotBeIn(Range <int> .FromInclusive(40).ToExclusive(50), message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "12345".MustMatch(new Regex(@"\W{5}"), exception: exception))) .Add(new CustomMessageTest <StringDoesNotMatchException>(message => "12345".MustMatch(new Regex(@"\W{5}"), message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => ((object)null).MustNotBeNull(exception))) .Add(new CustomMessageTest <ArgumentNullException>(message => ((object)null).MustNotBeNull(message: message))); }
void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData) { testData.Add(new CustomExceptionTest(exception => "Hello there!".MustContain("world", exception: exception))) .Add(new CustomMessageTest <StringException>(message => "42".MustContain("b", message: message))) .Add(new CustomMessageTest <StringException>(message => string.Empty.MustContain("a", message: message))); }