I have two unit test projects that test different Nancy modules. Both projects create a fake bootstrapper with something like this:
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
base.ConfigureApplicationContainer(container);
}
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
{
base.ApplicationStartup(container, pipelines);
}
The problem I'm having is when I run the tests individually, they work fine. When I run them all together it seems like one set of the modules gets loaded, and then one or the other set of unit tests pass, depending on the order the modules were loaded in.
This seems to only happen in MS Test running. I'm using NCrunch (another unit test runner framework) and it seems to work there.
So, I'm guessing the issue here is that TinyIoC or Nancy are not being completely refreshed between test assemblies, or because I'm using DefaultNancyBootstrapper and unit tests are all compiling into the same bin folder, it auto-discovers modules in other libraries that are not supposed to be loaded for the test being run (even though they are not referenced by the unit test project.)
Anyone run into something like this before?