public void GetType2_Nullable_Is_Null()
        {
            // arrange
            var typeInspector = new DefaultTypeInspector();

            // act
            void Action() => typeInspector.GetType(typeof(Foo), default !);
Example #2
0
        public void GetType2_Nullable_Is_Null()
        {
            // arrange
            var typeInspector = new DefaultTypeInspector();

            // act
            void Action() => typeInspector.GetType(typeof(Foo), default(bool?[]) !);

            // assert
            Assert.Throws <ArgumentNullException>(Action);
        }
Example #3
0
        public void CollectNullability_NonNull_StringType()
        {
            // arrange
            var           typeInspector = new DefaultTypeInspector();
            IExtendedType extendedType  = typeInspector.GetType(typeof(NonNullType <StringType>));

            // act
            bool?[] nullability = typeInspector.CollectNullability(extendedType);

            // assert
            Assert.Collection(nullability, item => Assert.False(item));
        }
Example #4
0
        public void CollectNullability_List_NonNull_StringType()
        {
            // arrange
            var           typeInspector = new DefaultTypeInspector();
            IExtendedType extendedType  = typeInspector.GetType(
                typeof(ListType <NonNullType <StringType> >));

            // act
            var nullability = typeInspector.CollectNullability(extendedType);

            // assert
            Assert.Collection(nullability, Assert.True, Assert.False);
        }