Improvements to the ExtensionManager #1746
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1744
This PR adds parameters to the
ExtensionManager
to control two aspects of it's behavior:The default Path used for extension points defined by the
TypeExtensionAttribute
. This was previously hard-coded as "/NUnit/Engine/TypeExtensions/" but is now set byExtensionService
andDriverService
when creating the manager.The prefixes used for recognizing extensions stored in standard locations relative to the engine. This was previously hard-coded as well, using "NUnit.Extension." for nuget and "nunit-extension-" for chocolatey. It is now set by the callers creating the manager.
The intent of this change is to make it easier for extensions not using the standard package naming to be located and installed. It enables use of
ExtensionManager
by additional NUnit components, i.e. other than the engine itself and potentially by third parties.ExtensionManager
is a somewhat low-level API and for most usage will probably be wrapped by a higher-level interface, which takes responsibility for creating the manager and setting parameters correctly. That's precisely the relationship between ourExtensionService
andExtensionManager
.