This is just a short FYI post because this caused me some
One thing to keep in mind when you are using StrucutreMap
and are Injecting Stubs into the ObjectFactory, you will want to reset the
ObjectFactory engine after you done with your tests.
To do this you will need to add this line of code.
How you implement this and where you put it is up to
you. I simply put this as the last line
of code in my tests, but you could put it in [TestFixtureTearDown] or if you wanted you
could wrap your entire test in a try-finally block and put it there (I did not
do this, did not think it was needed).
BTW, the error message you will receive if you have stubs
lingering around in your ObjectFactory is the following ‘This
action is invalid when the mock object is in verified state’.
Till next time
07-26-2007 7:05 AM