MethodWithSimilarArguments() 공개 메소드

public MethodWithSimilarArguments ( int flags, Bar bars ) : string
flags int
bars Bar
리턴 string
예제 #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));
        }