-
Notifications
You must be signed in to change notification settings - Fork 0
AssemblyAbstractions
LosManos edited this page Aug 2, 2021
·
1 revision
Makes it possible to mock (not yet)all of System.Reflection.Assembly.
It is very hard to test Assembly related stuff as all constructors are static.
This class mimics original Assembly behaviour (it calls the original Assembly) but makes everything mockable and/or testable.
- Some (not everything is implemented, yet) of System.Reflection.Assembly's instance methods and properties implemented as interface for making mocking easier.
- The static constructors are moved to the class AssemblyFactory
- When testing use the methods and properties in the partial class Assembly.Set to set explicit values.
Inject AssemblyFactory and the calls should be, almost, as original dotnet code.