コード例 #1
0
        public void ConstructorArgumentNullExceptionTest()
        {
            NuGenPropertyDescriptorCollection collection;

            try
            {
                collection = new NuGenPropertyDescriptorCollection(
                    null,
                    new object()
                    );

                Assert.Fail();
            }
            catch (ArgumentNullException)
            {
            }

            try
            {
                collection = new NuGenPropertyDescriptorCollection(
                    TypeDescriptor.GetProperties(new NuGenObjectDescriptorTests.DummyClass()),
                    null
                    );

                Assert.Fail();
            }
            catch (ArgumentNullException)
            {
            }
        }
コード例 #2
0
        public void IndexerPropertyNotFoundExceptionTest()
        {
            int foo = 0;

            NuGenPropertyDescriptorCollection collection = new NuGenPropertyDescriptorCollection(
                TypeDescriptor.GetProperties(foo),
                foo
                );

            NuGenPropertyDescriptor descriptor = collection["SomePropertyThatDoesNotExist"];
        }