I'm having trouble resetting StructureMap's configuration. This only fails when I run all my tests en mass. A previous test is Injecting an instance of SingleInvoicePresenter, but by the time I get to this test, I need all caching gone. I would think that ResetDefaults() would clear any previously injected objects out, but this test fails on the assert (when run with all the other tests)
StructureMap.ObjectFactory.ResetDefaults();
StructureMap.ObjectFactory.Configure(x => { x.For<SingleInvoicePresenter>().AlwaysUnique(); });
SingleInvoicePresenter P1 = StructureMap.ObjectFactory.GetInstance<SingleInvoicePresenter>();
SingleInvoicePresenter P2 = StructureMap.ObjectFactory.GetInstance<SingleInvoicePresenter>();
Assert.AreNotSame(P1, P2);
Edit - I would think this would work even without the line
StructureMap.ObjectFactory.Configure(x => { x.For<SingleInvoicePresenter>().AlwaysUnique(); });
but it fails with or without it.