Exemple #1
0
        public void PropertySetter_CustomType()
        {
            var setter = PropertySetter.CreateShadowNodeSetters(
                (MethodInfo)ReflectionHelpers.InfoOf(
                    (TestShadowNode t) => t.TestCustom(0))).Single();

            Assert.AreEqual("myInt", setter.PropertyType);
        }
Exemple #2
0
        public void PropertySetter_ArgumentChecks()
        {
            AssertEx.Throws <ArgumentNullException>(
                () => PropertySetter.CreateShadowNodeSetters(null).ToList(),
                ex => Assert.AreEqual("method", ex.ParamName));

            AssertEx.Throws <ArgumentNullException>(
                () => PropertySetter.CreateViewManagerSetters(null).ToList(),
                ex => Assert.AreEqual("method", ex.ParamName));
        }
Exemple #3
0
        public void PropertySetter_ShadowNode_PropertyType()
        {
            var setters = PropertySetter.CreateShadowNodeSetters(
                (MethodInfo)ReflectionHelpers.InfoOf(
                    (TestShadowNode t) => t.TestArray(null)));

            foreach (var setter in setters)
            {
                Assert.AreEqual("Array", setter.PropertyType);
            }
        }
Exemple #4
0
        public void PropertySetter_ShadowNode_Group()
        {
            var setters = PropertySetter.CreateShadowNodeSetters(
                (MethodInfo)ReflectionHelpers.InfoOf(
                    (TestShadowNode t) => t.TestGroup(0, null))).ToList();

            Assert.AreEqual(3, setters.Count);
            Assert.IsNotNull(setters.FirstOrDefault(s => s.Name == "foo"));
            Assert.IsNotNull(setters.FirstOrDefault(s => s.Name == "bar"));
            Assert.IsNotNull(setters.FirstOrDefault(s => s.Name == "baz"));

            foreach (var setter in setters)
            {
                Assert.AreEqual("String", setter.PropertyType);
            }
        }