Spring.Expressions.Foo.MethodWithSimilarArguments C# (CSharp) Method

MethodWithSimilarArguments() public method

public MethodWithSimilarArguments ( int flags, Bar bars ) : string
flags int
bars Bar
return string
        public string MethodWithSimilarArguments(int flags, Bar[] bars)
        {
            return "ExactMatch";
        }

Same methods

Foo::MethodWithSimilarArguments ( int flags, ICollection bar ) : string

Usage Example

Ejemplo n.º 1
0
        public void TestMethodResolutionResolvesToExactMatchOfArgumentTypes()
        {
            Dictionary<string, object> args = new Dictionary<string, object>();
            args["bars"] = new Bar[] { new Bar() };
            Foo foo = new Foo();

            // ensure noone changed our test class
            Assert.AreEqual("ExactMatch", foo.MethodWithSimilarArguments(1, (Bar[])args["bars"]));
            Assert.AreEqual("AssignableMatch", foo.MethodWithSimilarArguments(1, (ICollection)args["bars"]));

            Assert.AreEqual("ExactMatch", ExpressionEvaluator.GetValue(foo, "MethodWithSimilarArguments(1, #bars)", args));
        }