示例#1
0
        public void PropertyTab_Bitmap_GetInvalidMultipleTimes_ReturnsNull()
        {
            var tab = new SubPropertyTab();

            Assert.Null(tab.Bitmap);
            Assert.Null(tab.Bitmap);
        }
示例#2
0
        public void PropertyTab_Ctor_Default()
        {
            var tab = new SubPropertyTab();

            Assert.Null(tab.Bitmap);
            Assert.Null(tab.Components);
            Assert.Equal("TabName", tab.HelpKeyword);
        }
示例#3
0
        public void PropertyTab_Dispose_NoBitmapDisposing_Success(bool disposing)
        {
            var tab = new SubPropertyTab();

            tab.Dispose(disposing);
            Assert.Null(tab.Bitmap);

            // Dispose again.
            tab.Dispose(disposing);
            Assert.Null(tab.Bitmap);
        }
示例#4
0
        public void PropertyTab_GetProperties_InvokeWithAttributes_ReturnsExpected(ITypeDescriptorContext context, object component, Attribute[] attributes)
        {
            var tab = new SubPropertyTab();
            PropertyDescriptorCollection result = TypeDescriptor.GetProperties(typeof(ClassWithDefaultProperty));
            int callCount = 0;

            tab.GetPropertiesAction = (componentResult, attributesResult) =>
            {
                Assert.Same(component, componentResult);
                Assert.Same(attributes, attributesResult);
                callCount++;

                return(result);
            };
            Assert.Same(result, tab.GetProperties(context, component, attributes));
            Assert.Equal(1, callCount);
        }
示例#5
0
        public void PropertyTab_CanExtend_Invoke_ReturnsTrue(object extendee)
        {
            var tab = new SubPropertyTab();

            Assert.True(tab.CanExtend(extendee));
        }
示例#6
0
        public void PropertyTab_GetDefaultProperty_InvokeNullComponent_ReturnsExpected()
        {
            var tab = new SubPropertyTab();

            Assert.Null(tab.GetDefaultProperty(null));
        }
示例#7
0
        public void PropertyTab_GetDefaultProperty_InvokeWithDefaultProperty_ReturnsExpected()
        {
            var tab = new SubPropertyTab();

            Assert.Equal("Value", tab.GetDefaultProperty(new ClassWithDefaultProperty()).Name);
        }
示例#8
0
        public void PropertyTab_GetDefaultProperty_InvokeWithoutDefaultProperty_ReturnsExpected()
        {
            var tab = new SubPropertyTab();

            Assert.Null(tab.GetDefaultProperty(new ClassWithoutDefaultProperty()));
        }