I appreciate that someone can help me with the problem described below: I used RhinoMock in Unit Test. I define my object layout in this way, with sessionToken in lowercase form:
mockRepository.Stub(repository => repository.FindById(sessionToken)).Return(new DeviceTypeRepository().NewTable(false));
This is normal for the code section when calling FindById () to return a valid new new DeviceTypeRepository (). NewTable (false);
However, if a complex parameter as an object is included in the Stub, for example, a DataTable, as shown below:
mockRepository.Stub(repository => repository.Find(sessionToken, dataTable)).Return(new DeviceTypeRepository().NewTable(false));
Then the section of code in which Find () is called, it does NOT return the expected new DeviceTypeRepository (). NewTable (false). Note that the input value of the dataTable parameter is the same both in the Stub call and in Find ().
Therefore, my question is: How could I implement such a parameter (typed DataTable and in general) into Stub initialization using RhinoMock? I would appreciate any advice and approaches. Thanks
source share