public void TestExtensionMethodDeclaration() { AssemblyTypesInfo assemblyTypesInfo = new AssemblyTypesInfo(Assembly.GetExecutingAssembly()); IEnumerable <MethodInfo> extentions = assemblyTypesInfo.GetExtensionMethods(typeof(string).GetTypeInfo()); Assert.AreEqual(1, extentions.Count()); Assert.AreEqual("ExtMethod", extentions.First().Name); }
//TODO: Add null showList parametr concatenation private void AddExtMethodsToMethodShowListOfSelectedType(ref IEnumerable <string> showList) { IEnumerable <string> extensionMethodsDeclarations = AssemblyTypesInfo.GetExtensionMethods(selectedType)?.Select(mi => mi.GetDeclaration()).ToList(); if (extensionMethodsDeclarations != null) { showList = showList?.Concat(extensionMethodsDeclarations).ToList(); } }