コード例 #1
0
 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)));
 }
コード例 #2
0
 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)));
 }
コード例 #3
0
 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)));
 }
コード例 #4
0
        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)));
        }
コード例 #5
0
 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)));
 }
コード例 #6
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.Add(new CustomExceptionTest(exception => 2.MustBeGreaterThanOrEqualTo(42, exception)))
     .Add(new CustomMessageTest <ArgumentOutOfRangeException>(message => 30.MustBeGreaterThanOrEqualTo(31, message: message)));
 }
コード例 #7
0
 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)));
 }
コード例 #8
0
 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)));
 }
コード例 #9
0
 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)));
 }
コード例 #10
0
 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)));
 }
コード例 #11
0
 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)));
 }
コード例 #12
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.Add(new CustomExceptionTest(exception => true.MustBeFalse(exception: exception)))
     .Add(new CustomMessageTest <ArgumentException>(message => true.MustBeFalse(message: message)));
 }
コード例 #13
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.Add(new CustomExceptionTest(exception => "!".MustContainOnlyLetters(exception: exception)))
     .Add(new CustomMessageTest <StringException>(message => "$".MustContainOnlyLetters(message: message)));
 }
コード例 #14
0
 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)));
 }
コード例 #15
0
 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)));
 }
コード例 #16
0
 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)));
 }
コード例 #17
0
 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)));
 }
コード例 #18
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.Add(new CustomExceptionTest(exception => ((object)null).MustNotBeNull(exception)))
     .Add(new CustomMessageTest <ArgumentNullException>(message => ((object)null).MustNotBeNull(message: message)));
 }
コード例 #19
0
 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)));
 }