Hi,
Anyway, I'm not really sure I understand what you're actual intention. for me it looks as if I'm looking at half the implementation. you are trying to test SimpleClass which is dependent on TWO other type:
* FreeForm which is created in the constructor
* PreFreeForm which is the
prff field (does does not get initialized anywhere).
If everything was in place our actual test should have looked like:
[Test, VerifyMocks]
public void MockInternal()
{
Mock moprff = MockManager.MockAll(typeof(PreFreeForm));
moprff.ExpectGetAlways("Count", 7);
Mock mo = MockManager.MockAll(typeof(FreeForm));
SimpleClass sc = new SimpleClass();
}
However for this to work the instance field
prff MUST be initialized somewhere. If its not done, the CLR will throw a NullReferanceException the minute it encounters the
prff.Count statement no matter what is mocked.
:!: in our next release we will include an API for Mocking Fields that as far as i can tell will be extremely useful in this situation. if you like i will add you to our beta users list.