I would like to be able to access the existing test infrastructure in Nop.Tests so we can more easily create tests for plugins.
I looked are various ways of going about it and I expect the ideal solution would be to separate out all of the test infrastructure code into its own assembly and then other test projects with actual tests (such as Nop.Test) use that.
But to minimize any impact I and looking at a different solution initially (although this could be a precursor to the more ideal solution).
Right now I am linking in the additional test code to the main Nop.Test project along with adding the plugin(s) as dependencies. But we still need some modifications to the test infrastructure to be able to do the following:
- Apply schema migrations that the plug in requires (i.e. add necessary tables)
- Register the additional services the plugin needs
The basic plan to solve the couple of issues above is to add some new abstract classes (and/or interfaces) and then the BaseNopTest static constructor and Init methods will need to locate these new classes to apply the changes/register services etc. This requires probably about a dozen lines of code added and won't impact the existing tests (since no concrete versions of these classes will exist).
But just looking for any feedback at this point (I could easily have missed some existing options that are there but I couldn't see anything obvious around extending the current tests to register additional services for example).
Will update this with link to the fork and additional documentation/examples etc once I have something in place (I already have a basic proof of concept working here).
I would like to be able to access the existing test infrastructure in Nop.Tests so we can more easily create tests for plugins.
I looked are various ways of going about it and I expect the ideal solution would be to separate out all of the test infrastructure code into its own assembly and then other test projects with actual tests (such as Nop.Test) use that.
But to minimize any impact I and looking at a different solution initially (although this could be a precursor to the more ideal solution).
Right now I am linking in the additional test code to the main Nop.Test project along with adding the plugin(s) as dependencies. But we still need some modifications to the test infrastructure to be able to do the following:
The basic plan to solve the couple of issues above is to add some new abstract classes (and/or interfaces) and then the BaseNopTest static constructor and Init methods will need to locate these new classes to apply the changes/register services etc. This requires probably about a dozen lines of code added and won't impact the existing tests (since no concrete versions of these classes will exist).
But just looking for any feedback at this point (I could easily have missed some existing options that are there but I couldn't see anything obvious around extending the current tests to register additional services for example).
Will update this with link to the fork and additional documentation/examples etc once I have something in place (I already have a basic proof of concept working here).