I am trying to modify unit testing of ArcGIS and start using mocks (I use rhino).
When I started writing tests, I noticed that I should start taunting a lot of objects and stopping a lot of methods even for passing one test.
For example, my controller first receives RelationshipClass(so I need to stub IWorkspaceand returned IRelationshipClass), then it also receives IFeature(A stub) and finally calls stubRelClass.GetRelatedObjects(stubFeature)to return a ISetothers IFeatures.
Is it normal to have so many objects and methods that they go through? I also feel, for example, that I really need to step over the code (yes, I know that I had to write tests first, I'm still trying to do this) to find out what to do next and what I should return.
I also have a problem with mocking com classes that implement more than one interface. In the production code, I QI them between the interfaces. How can I create a layout that implements both interfaces at runtime?
source
share