Ejemplo n.º 1
0
        public void MethodLookupTest2()
        {
            var holder  = new GenericMethodHolder(typeof(GenericMethodHolderTests), "MyTest", 2, typeof(int), typeof(string));
            var result1 = holder.Invoke(this, new[] { typeof(object), typeof(object) }, 1, "123");
            var result2 = holder.Invoke(this, new[] { typeof(object), typeof(object) }, 1, "123");             // test cache

            Assert.AreEqual("MyTest<T, X>(int a, string b)", result1);
            Assert.AreEqual(result1, result2);
        }
Ejemplo n.º 2
0
        public void MethodLookupTest3()
        {
            var holder = new GenericMethodHolder(typeof(GenericMethodHolderTests), "MyTest", 2);
            var result = holder.Invoke(this, new[] { GetType(), GetType() });

            Assert.AreEqual("MyTest<T, X>()", result);
        }
Ejemplo n.º 3
0
        public void MethodLookupTest1()
        {
            var holder = new GenericMethodHolder(typeof(GenericMethodHolderTests), "MyTest", 2, null, null, typeof(int), typeof(bool));
            var result = holder.Invoke(this, new[] { typeof(object), typeof(object) }, null, null, 1, true);

            Assert.AreEqual("MyTest<T, X>(T t, X x, int a, bool b)", result);
            Assert.AreEqual("System.String MyTest[T,X](T, X, Int32, Boolean)", holder.ToString());
        }
 public object Compute_A_B(Type A, Type B, object a, int b, string c)
 {
     return(computeHolder.Invoke(instance, new[] { A, B }, a, b, c));
 }
 public void DoSomething_A_B_C(Type A, Type B, Type C, object a, object b, object c)
 {
     doSomethingHolder.Invoke(instance, new[] { A, B, C }, a, b, c);
 }
 public bool Equals_T(Type t1, object a, object b)
 {
     return((bool)equalsHolder.Invoke(instance, new[] { t1 }, new[] { a, b }));
 }
 public object GetDefault_T(Type t1)
 {
     return(getDefaultHolder.Invoke(instance, new[] { t1 }, new object[0]));
 }