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)); }
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)); }
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)); }
public void ResolveParameters_ValidatesParameters() { var resolver = new ParameterResolver(); Should.Throw <ArgumentNullException>(() => resolver.ResolveParameters(null)); }