I have the duty to make a test class for a method able to load plugins. Plugins are defined as classes that implement the interface IPlugin. The method works receiving a path to a folder and looking for all assemblies in that folder in order to enumerate all plugins defined in these assemblies.
For unit testing, I'd like to generate plugins dinamically, so I could control testing cenarios. All I want is:
1) create a plugin.cs inside my test project and define a plugin. 2) On the test, dynamically create an assembly with the plugin.cs code inside it.
How could it be done in c#?