Hello,
I am creating a DynamicMultiMock as follows:
this.serviceClient = this.mocks.DynamicMultiMock<ISlippyPlateProcedureService>(typeof(ICommunicationObject));
Then setting the following expectation:
Expect.Call(((ICommunicationObject)this.serviceClient).State).Return(CommunicationState.Faulted);
When I execute the test, Rhino Mocks reports this:
Replayed expectation: ICommunicationObject.get_State();
Dynamic Mock: Unexpected method call ignored: ICommunicationObject.get_State();
Am I correctly setting this expectation or is there another way?
Editing to include the complete test code:
Expect.Call(this.syncContextContainer.SynchronizationContext).Return(new SlippyPlateProcedureSynchronizationContextMock());
Expect.Call(this.clientFactory.CreateServiceClient(null)).IgnoreArguments().Return(this.serviceClient);
Expect.Call(((ICommunicationObject)this.serviceClient).State).Return(CommunicationState.Faulted);
Expect.Call(() => this.serviceClient.IsAlive());
this.mocks.ReplayAll();
SlippyPlateProcedureClient client = new SlippyPlateProcedureClient(
this.syncContextContainer, this.clientFactory, this.container);
PrivateObject privateObject = new PrivateObject(client);
SlippyPlateProcedureClient_Accessor target = new SlippyPlateProcedureClient_Accessor(privateObject);
target.CheckServerConnectivity();
this.mocks.VerifyAll();
Thanks
Andrey