问题
I have a set of Visual Studio Team System unit (integration really) tests that talk to a remote database. The tests are getting too slow and unwieldy. I'd like to replace the entire set of tests with mocked out versions. The problem is it's painful to write all the expect statements that mimic what an entire database does.
Does anyone know of a tool or add-on that will run an existing test, figure out what the non-mocked version actually returns and write out the Expect.Call's to duplicate the functionality? I know this is a long shot, but I feel like it should be possible.
回答1:
Ok, I ended up writing it myself. Here is the blog post overview:
Write My Rhino Mocks Expect Statement
And here is the CodePlex project:
WriteMyExpectStatement
Hope this helps someone somewhere.
来源:https://stackoverflow.com/questions/218180/can-rhino-mocks-write-my-expect-statements-for-me