I've finished going through the acceptance tests and have added extra cases
for exercising class-based mocks. Overall, we now have an additional 30
tests in this suite. Points of note follow:
- Refactored all fixtures so that they descend from
AcceptanceTestBase. As a general rule tests now delegate the creation of
Mockery instances and verification back to this base class.
- I did a small amount of tidying up, but for the most part, the
internal test code remains unchanged.
- I had to change the namespace of the 'BugReproduction' fixtures
so that they could be affected by the SetupFixture logic in SetupFixture.cs.
- Decorated some tests with custom NUnit category attributes.
[Class] indicates that the test should not be run against IMockObjectFactory
implementations that do not support class mocking. The [CastleOnly]
attribute is used much more rarely, and indicates that the test is only
intended to be run against the castle-based implementation. This latter case
generally only happens when we have implemented a new feature that affects
proxy internals, but have not back ported it to the legacy mock object
factory code. Point in case would be the
- This suite now uses NUnit 188.8.131.52.
Things that need to happen from here:
1. Update the build script so that it first compiles
NMock2.AcceptanceTests with the INTERFACEONLY compiler define, and then runs
NUnit excluding the 'Class' and 'CastleOnly' categories. After this we can
recompile without the define and run the test suite normally. Urs, could you
help with this?
2. Could someone take a look at ThreadSynchronizationAcceptanceTest? I
had some trouble getting this to pass after descending from
AcceptanceTestBase, and after some casual inspection am not at all sure that
it is actually doing what is expected. I've marked it with [Ignore] for now.
3. Consider doing something similar for the standard unit test suite.
Not as radical though - probably just sprinkling some [Class] attributes
around for the most part so that the tests can still be run against the