public void TestExtensionMethodBrowsing() { var usings = new string[] { "System", "System.Linq" }; IAddonManager addons = AddonManager.Create(); addons.AddAssembly(typeof(System.Linq.Enumerable).Assembly, false); var methods = new List <System.Reflection.MethodInfo>( addons.ListExtensionMethods( typeof(IEnumerable <int>)).Where(mi => mi.Name == "Select")); Assert.IsTrue(methods.Select(mi => mi.Name).Contains("Select")); methods = new List <System.Reflection.MethodInfo>( addons.ListExtensionMethods( typeof(List <int>)).Where(mi => mi.Name == "Select")); Assert.IsTrue(methods.Select(mi => mi.Name).Contains("Select")); }
[Ignore] // Enable again when some extension methods actually are added. public void TestExtensionMethods() { var usings = new string[] { "StepBro.Core.Execution" }; IAddonManager addons = AddonManager.Create(); addons.AddAssembly(AddonManager.StepBroCoreAssembly, false); var methods = addons.ListExtensionMethods( typeof(IProcedureReference)).Where(mi => mi.Name == "DynamicInvoke").ToList(); Assert.AreEqual(1, methods.Count); Assert.AreEqual("DynamicInvoke", methods[0].Name); }