MethodWithSimilarArguments() public method

public MethodWithSimilarArguments ( int flags, Bar bars ) : string
flags int
bars Bar
return string
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));
        }