Exemplo n.º 1
0
        public void ResolveParameters_IgnoresPropertiesWithoutPublicSetter()
        {
            var resolver = new ParameterResolver();

            var res = resolver.ResolveParameters(typeof(S4));

            res.Count().ShouldBe(1);
            res.ElementAt(0).Name.ShouldBe("Test");
            res.ElementAt(0).PropertyType.ShouldBe(typeof(string));
        }
Exemplo n.º 2
0
        public void ResolveParameters_ResolvesSingleParameter()
        {
            var resolver = new ParameterResolver();

            var res = resolver.ResolveParameters(typeof(S1));

            res.Count().ShouldBe(1);
            res.ElementAt(0).Name.ShouldBe("Test");
            res.ElementAt(0).PropertyType.ShouldBe(typeof(string));
        }
Exemplo n.º 3
0
        public void ResolveParameters_ResolvesMultipleParameters()
        {
            var resolver = new ParameterResolver();

            var res = resolver.ResolveParameters(typeof(S2));

            res.Count().ShouldBe(2);
            res.ElementAt(0).Name.ShouldBe("Test");
            res.ElementAt(0).PropertyType.ShouldBe(typeof(string));
            res.ElementAt(1).Name.ShouldBe("Foo");
            res.ElementAt(1).PropertyType.ShouldBe(typeof(int));
        }
Exemplo n.º 4
0
        public void ResolveParameters_ValidatesParameters()
        {
            var resolver = new ParameterResolver();

            Should.Throw <ArgumentNullException>(() => resolver.ResolveParameters(null));
        }