public void WrappedInterfaceHasWrappedGenericMethods2() { var source = typeof(IGenericInterface); var wrapped = GenericInterfaceWrapper.Wrap(source); var mi = source.GetMethod("DoSomething"); var newName = GenericInterfaceWrapper.GetWrappedName(mi); mi = wrapped.GetMethod(newName); Assert.IsNotNull(mi); var parameters = mi.GetParameters(); Assert.AreEqual(6, parameters.Length); Assert.AreEqual(typeof(void), mi.ReturnType); // generic parameters Assert.AreEqual(typeof(Type), parameters[0].ParameterType); Assert.AreEqual(typeof(Type), parameters[1].ParameterType); Assert.AreEqual(typeof(Type), parameters[2].ParameterType); // method arguments Assert.AreEqual(typeof(object), parameters[3].ParameterType); Assert.AreEqual(typeof(object), parameters[4].ParameterType); Assert.AreEqual(typeof(object), parameters[5].ParameterType); }
public void WrappedMethodNameTest2() { var mi = typeof(IGenericInterface).GetMethod("DoSomething"); Assert.IsNotNull(mi); var newName = GenericInterfaceWrapper.GetWrappedName(mi); Assert.AreEqual("DoSomething<A, B, C>", newName); }
public void WrappedMethodNameTest1() { var mi = typeof(IGenericInterface).GetMethod("GetVersion"); Assert.IsNotNull(mi); var newName = GenericInterfaceWrapper.GetWrappedName(mi); Assert.AreEqual("GetVersion", newName); // same as above }