コード例 #1
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(IContainer).MustNotBeInterface(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(IChangeTracking).MustNotBeInterface(message: message));

            testData.AddExceptionTest(exception => typeof(IEqualityComparer <>).GetTypeInfo().MustNotBeInterface(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(ICommand).GetTypeInfo().MustNotBeInterface(message: message));
        }
コード例 #2
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(string).MustBeEnum(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(IComparable).MustBeEnum(message: message));

            testData.AddExceptionTest(exception => typeof(object).GetTypeInfo().MustBeEnum(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(IList).GetTypeInfo().MustBeEnum(message: message));
        }
コード例 #3
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(Action).MustNotBeDelegate(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Func <>).MustNotBeDelegate(message: message));

            testData.AddExceptionTest(exception => typeof(PropertyChangedEventHandler).GetTypeInfo().MustNotBeDelegate(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(AsyncCallback).GetTypeInfo().MustNotBeDelegate(message: message));
        }
コード例 #4
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(IFormattable).MustBeStaticClass(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Action).MustBeStaticClass(message: message));

            testData.AddExceptionTest(exception => typeof(decimal).GetTypeInfo().MustBeStaticClass(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(FieldInfo).GetTypeInfo().MustBeStaticClass(message: message));
        }
コード例 #5
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(GC).MustNotBeStaticClass(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Console).MustNotBeStaticClass(message: message));

            testData.AddExceptionTest(exception => typeof(Nullable).GetTypeInfo().MustNotBeStaticClass(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Convert).GetTypeInfo().MustNotBeStaticClass(message: message));
        }
コード例 #6
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(IComparable).MustBeClass(exception))
            .AddMessageTest <TypeException>(message => typeof(Func <object>).MustBeClass(message: message));

            testData.AddExceptionTest(exception => typeof(double).GetTypeInfo().MustBeClass(exception))
            .AddMessageTest <TypeException>(message => typeof(Action).GetTypeInfo().MustBeClass(message: message));
        }
コード例 #7
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(IList).MustBeDelegate(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(BindingFlags).MustBeDelegate(message: message));

            testData.AddExceptionTest(exception => typeof(string).GetTypeInfo().MustBeDelegate(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(IDisposable).GetTypeInfo().MustBeDelegate(message: message));
        }
コード例 #8
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(string).MustNotBeClass(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(object).MustNotBeClass(message: message));

            testData.AddExceptionTest(exception => typeof(Math).GetTypeInfo().MustNotBeClass(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Exception).GetTypeInfo().MustNotBeClass(message: message));
        }
コード例 #9
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(object).MustBeValueType(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Action).MustBeValueType(message: message));

            testData.AddExceptionTest(exception => typeof(string).GetTypeInfo().MustBeValueType(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(IDisposable).GetTypeInfo().MustBeValueType(message: message));
        }
コード例 #10
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => 0.MustNotBeDefault(exception))
            .AddMessageTest <ArgumentDefaultException>(message => default(char).MustNotBeDefault(message: message));

            testData.AddExceptionTest(exception => default(object).MustNotBeDefault(exception))
            .AddMessageTest <ArgumentNullException>(message => default(string).MustNotBeDefault(message: message));
        }
コード例 #11
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(ConsoleColor).MustBeInterface(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(Action).MustBeInterface(message: message));

            testData.AddExceptionTest(exception => typeof(string).GetTypeInfo().MustBeInterface(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(int).GetTypeInfo().MustBeInterface(message: message));
        }
コード例 #12
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(ConsoleColor).MustNotBeEnum(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(ConsoleColor).MustNotBeEnum(message: message));

            testData.AddExceptionTest(exception => typeof(GCCollectionMode).GetTypeInfo().MustNotBeEnum(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(AttributeTargets).GetTypeInfo().MustNotBeEnum(message: message));
        }
コード例 #13
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(IDisposable).MustBeStruct(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(ConsoleKey).MustBeStruct(message: message));

            testData.AddExceptionTest(exception => typeof(Action).GetTypeInfo().MustBeStruct(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(BindingFlags).GetTypeInfo().MustBeStruct(message: message));
        }
コード例 #14
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(int).MustBeReferenceType(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(float).MustBeReferenceType(message: message));

            testData.AddExceptionTest(exception => typeof(decimal).GetTypeInfo().MustBeReferenceType(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(BindingFlags).GetTypeInfo().MustBeReferenceType(message: message));
        }
コード例 #15
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => typeof(int).MustNotBeStruct(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(ConsoleKeyInfo).MustNotBeStruct(message: message));

            testData.AddExceptionTest(exception => typeof(double).GetTypeInfo().MustNotBeStruct(exception: exception))
            .AddMessageTest <TypeException>(message => typeof(long).GetTypeInfo().MustNotBeStruct(message: message));
        }
コード例 #16
0
        void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
        {
            testData.AddExceptionTest(exception => string.Empty.MustNotBeNullOrWhiteSpace(exception: exception))
            .AddExceptionTest(exception => "    ".MustNotBeNullOrWhiteSpace(exception: exception))
            .AddExceptionTest(exception => "\t\r\n".MustNotBeNullOrWhiteSpace(exception: exception));

            testData.AddMessageTest <EmptyStringException>(message => string.Empty.MustNotBeNullOrWhiteSpace(message: message))
            .AddMessageTest <StringIsOnlyWhiteSpaceException>(message => "    ".MustNotBeNullOrWhiteSpace(message: message))
            .AddMessageTest <StringIsOnlyWhiteSpaceException>(message => "\t\r\n".MustNotBeNullOrWhiteSpace(message: message));
        }
コード例 #17
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => true.MustNotBeTrue(exception))
     .AddMessageTest <ArgumentException>(message => true.MustNotBeTrue(message: message));
 }
コード例 #18
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => "Foo".MustNotBeEquivalentTo("foo", exception: exception))
     .AddMessageTest <StringException>(message => "Foo".MustNotBeEquivalentTo("Foo", message: message));
 }
コード例 #19
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => typeof(string).MustNotImplement(typeof(IEnumerable <>), exception: exception))
     .AddMessageTest <TypeException>(message => typeof(string).MustNotImplement(typeof(IEnumerable <char>), message: message));
 }
コード例 #20
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => typeof(int).MustNotDeriveFrom(typeof(ValueType), exception: exception))
     .AddMessageTest <TypeException>(message => typeof(ArgumentException).MustNotDeriveFrom(typeof(Exception), message: message));
 }
コード例 #21
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => typeof(Action).MustImplement(typeof(IProgress <>), exception: exception))
     .AddMessageTest <TypeException>(message => typeof(Exception).MustImplement(typeof(IComparable), message: message));
 }
コード例 #22
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => "Foo".MustHaveMinimumLength(4, exception: exception))
     .AddMessageTest <StringException>(message => "Bar".MustHaveMinimumLength(42, message: message));
 }
コード例 #23
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => string.Empty.MustNotBeNullOrEmpty(exception: exception))
     .AddMessageTest <EmptyStringException>(message => string.Empty.MustNotBeNullOrEmpty(message: message));
 }
コード例 #24
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => "abcde".MustContainOnlyDigits(exception: exception))
     .AddMessageTest <StringException>(message => "Foo".MustContainOnlyDigits(message: message));
 }
コード例 #25
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => "Foo".MustMotHaveLengthIn(Range <int> .FromInclusive(2).ToInclusive(3), exception: exception))
     .AddMessageTest <StringException>(message => "Bar".MustMotHaveLengthIn(Range <int> .FromInclusive(2).ToInclusive(3), message: message));
 }
コード例 #26
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => typeof(double).MustBeAbstraction(exception: exception))
     .AddMessageTest <TypeException>(message => typeof(Version).MustBeAbstraction(message: message));
 }
コード例 #27
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => typeof(string).MustDeriveFromOrImplement(typeof(double), exception: exception))
     .AddMessageTest <TypeException>(message => typeof(decimal).MustDeriveFromOrImplement(typeof(ICollection <>), message: message));
 }
コード例 #28
0
 void ICustomMessageAndExceptionTestDataProvider.PopulateTestDataForCustomExceptionAndCustomMessageTests(CustomMessageAndExceptionTestData testData)
 {
     testData.AddExceptionTest(exception => ((double?)null).MustHaveValue(exception))
     .AddMessageTest <NullableHasNoValueException>(message => ((int?)null).MustHaveValue(message: message));
 }