コード例 #1
0
        public void ViewManagersPropCache_GetNativePropsForView()
        {
            var props = ViewManagersPropCache.GetNativePropsForView <object>(typeof(ViewManagerValueTest), typeof(ShadowNodeValueTest));

            Assert.AreEqual(5, props.Count);
            Assert.AreEqual("number", props["Foo"].Value <string>());
            Assert.AreEqual("String", props["Bar1"].Value <string>());
            Assert.AreEqual("String", props["Bar2"].Value <string>());
            Assert.AreEqual("String", props["Qux1"].Value <string>());
            Assert.AreEqual("String", props["Qux2"].Value <string>());
        }
コード例 #2
0
        public void ViewManagersPropCache_ArgumentChecks()
        {
            AssertEx.Throws <ArgumentNullException>(
                () => ViewManagersPropCache.GetNativePropsForView <object>(null, typeof(object)),
                ex => Assert.AreEqual("viewManagerType", ex.ParamName));

            AssertEx.Throws <ArgumentNullException>(
                () => ViewManagersPropCache.GetNativePropsForView <object>(typeof(object), null),
                ex => Assert.AreEqual("shadowNodeType", ex.ParamName));

            AssertEx.Throws <ArgumentNullException>(
                () => ViewManagersPropCache.GetNativePropSettersForViewManagerType <object>(null),
                ex => Assert.AreEqual("type", ex.ParamName));

            AssertEx.Throws <ArgumentNullException>(
                () => ViewManagersPropCache.GetNativePropSettersForShadowNodeType
                    (null),
                ex => Assert.AreEqual("type", ex.ParamName));
        }