Ok, I figured it out. Drop me as another victim for the intricacies of Rhino. This type of thing makes me want to move on to a simpler structure, maybe I'll check MoQ.
So the answer uses PartialMocks. I played briefly with generating a partial layout, but when I started the debugger, I noticed that the properties were not even null, they threw strange exceptions, so I did not look much deeper. I used short format AAA syntax.
It turns out that if I just put the layout in playback mode, the test works - the properties are used as they are (as it should be with a partial layout).
So here is the answer:
[Test] public void ShouldCreateParameterListInConstructor() { var mockRepository = new MockRepository(); var mock = mockRepository.PartialMock<DataCollectionWorkflow>(); using ( mockRepository.Record() ) { } using (mockRepository.Playback()) { Assert.That(mock.Parameters, Is.Not.Null, "DataCollectionWorkflow base class didn't create new param collection"); } }
I understand that this is a performance test, but in fact it is a simpler prelude to some behavioral testing, which includes this property, so I wanted this case to be a precondition. Hope this helps someone.
womp
source share