public void Method_Matches_True() { var type = module.GetType("Com.Mypackage.Foo"); var @class = new ManagedClassGen(type, options); var unknownTypes = type.Methods.First(m => m.Name == "UnknownTypes"); var methodA = new ManagedMethod(@class, unknownTypes); var methodB = new ManagedMethod(@class, unknownTypes); Assert.IsTrue(methodA.Matches(methodB), "Methods should match!"); }
public void Method_Matches_False() { var type = module.GetType("Com.Mypackage.Foo"); var @class = new ManagedClassGen(type, options); var unknownTypesA = type.Methods.First(m => m.Name == "UnknownTypes"); var unknownTypesB = type.Methods.First(m => m.Name == "UnknownTypesReturn"); unknownTypesB.Name = "UnknownTypes"; var methodA = new ManagedMethod(@class, unknownTypesA); var methodB = new ManagedMethod(@class, unknownTypesB); //Everything the same besides return type Assert.IsFalse(methodA.Matches(methodB), "Methods should not match!"); }