Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/testcentric.extensibility/ExtensionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,29 @@ public void FindExtensionPoints(params Assembly[] targetAssemblies)

log.Info($"Assembly: {assemblyName.Name}");

foreach (Type type in assembly.GetExportedTypes())
try
{
try
// First check for ExtensionPoint attributes on the assembly.
foreach (ExtensionPointAttribute attr in assembly.GetCustomAttributes(typeof(ExtensionPointAttribute), false))
AddExtensionPoint(attr.Path, attr.Type, assemblyName, attr.Description);

foreach (NUNIT.ExtensionPointAttribute attr in assembly.GetCustomAttributes(typeof(NUNIT.ExtensionPointAttribute), false))
AddExtensionPoint(attr.Path, attr.Type, assemblyName, attr.Description);

// Check each exported type for TypeExtensionPoint attributes
foreach (Type type in assembly.GetExportedTypes())
{
foreach (TypeExtensionPointAttribute attr in type.GetCustomAttributes(typeof(TypeExtensionPointAttribute), false))
AddExtensionPoint(attr.Path ?? TypeExtensionPath + type.Name, type, assemblyName, attr.Description);

foreach (ExtensionPointAttribute attr in assembly.GetCustomAttributes(typeof(ExtensionPointAttribute), false))
AddExtensionPoint(attr.Path, attr.Type, assemblyName, attr.Description);

foreach (NUNIT.TypeExtensionPointAttribute attr in type.GetCustomAttributes(typeof(NUNIT.TypeExtensionPointAttribute), false))
AddExtensionPoint(attr.Path ?? NUNIT_TYPE_EXTENSIONS_PATH + type.Name, type, assemblyName, attr.Description);

foreach (NUNIT.ExtensionPointAttribute attr in assembly.GetCustomAttributes(typeof(NUNIT.ExtensionPointAttribute), false))
AddExtensionPoint(attr.Path, attr.Type, assemblyName, attr.Description);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}

void AddExtensionPoint(string path, Type type, AssemblyName assemblyName, string? description = null)
Expand Down
Loading