예제 #1
0
        public void SetParameterTest(Dictionary <string, string> parameters, object expected)
        {
            var component = new TestComponent();

            NativeComponentRenderer.SetNavigationParameters(component, parameters);

            var prop  = component.GetType().GetProperty(parameters.FirstOrDefault().Key);
            var value = prop.GetValue(component);

            Assert.AreEqual(expected, value);
        }
예제 #2
0
        public void SetParameterTest(Dictionary <string, object> parameters)
        {
            var component = new TestComponent();

            NativeComponentRenderer.SetParameterArguments(component, parameters);

            var parameterKeyValue = parameters.FirstOrDefault();
            var prop        = component.GetType().GetProperty(parameterKeyValue.Key);
            var actualValue = prop.GetValue(component);

            Assert.AreEqual(parameterKeyValue.Value, actualValue);
        }
예제 #3
0
        public void GeneticComponent_ValidateProperty_PropertyInfo()
        {
            TestComponent component = new TestComponent();

            // is valid
            component.TestValidateProperty(1, nameof(component.IntValue));

            // is not valid
            Assert.Throws <ValidationException>(() => component.TestValidateProperty(11, component.GetType().GetProperty(nameof(component.IntValue))));
        }