コード例 #1
0
        public void DescribeComponent_IgnoreNonExtenderControlPropertyAndNonExtenderControlEvent()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>(MockBehavior.Strict);

            ComponentDescriber.DescribeComponent(new Extender {
                PropWithNoAttributes = 123
            }, descriptorMock.Object, null, null);
        }
コード例 #2
0
        public void DescribeComponent_DefaultProperty()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>(MockBehavior.Strict);

            ComponentDescriber.DescribeComponent(new ExtenderWithNonDefaultValues {
                Prop = 999, EventProp = "BCD", ElementProp = "BCD", ComponentProp = "BCD"
            }, descriptorMock.Object, null, null);
        }
コード例 #3
0
        public void DescribeComponent_DoNotSerializeNullValue()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>(MockBehavior.Strict);

            ComponentDescriber.DescribeComponent(new Extender {
                NullableProp = null
            }, descriptorMock.Object, null, null);
        }
コード例 #4
0
        public void DescribeComponent_PropertyName()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>();

            ComponentDescriber.DescribeComponent(new ExtenderWithNonDefaultValues {
                Prop = 123
            }, descriptorMock.Object, null, null);

            descriptorMock.Verify(d => d.AddProperty("Prop", It.IsAny <object>()), Times.Once);
        }
コード例 #5
0
        public void DescribeComponent_DateTimeValue()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>();

            ComponentDescriber.DescribeComponent(new Extender {
                DateTimeProp = new DateTime(2000, 1, 2, 3, 4, 5, 6)
            }, descriptorMock.Object, null, null);

            descriptorMock.Verify(d => d.AddProperty("DateTimeProp", "2000-01-02T03:04:05"), Times.Once);
        }
コード例 #6
0
        public void DescribeComponent_ObjectValue()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>();

            ComponentDescriber.DescribeComponent(new Extender {
                ObjectProp = new TestObject()
            }, descriptorMock.Object, null, null);

            descriptorMock.Verify(d => d.AddProperty("ObjectProp", "TestObjectSerialized"), Times.Once);
        }
コード例 #7
0
        public void DescribeComponent_ComponentName()
        {
            var descriptorMock = new Mock <IScriptComponentDescriptor>();

            ComponentDescriber.DescribeComponent(new ExtenderWithNonDefaultValues {
                ComponentProp = "ABC"
            }, descriptorMock.Object, null, null);

            descriptorMock.Verify(d => d.AddComponentProperty("ComponentProp", It.IsAny <string>()), Times.Once);
        }