How to reset the mockrepository object to call the original method after all the calls in mocks.record() are made? -
i have .net 3.5 win form application 3 classes login.cs,main.cs,dbtansaction.cs. writing testcase main.cs makes calls dbtransaction.cs. mocked dbtransaction.cs return diff values each call , works fine. after testcase run in teardown, close application calls login.cs check if user allowed close application. login.cs makes call dbtransaction.cs , since mocked class in testcase throws exception saying unexpected call.
how reset mock objec redirect original dbtransactio.cs when called teardown.
thanks
if you're writing unit test main.cs, of dependencies (login , dbtransaction) should mocked. you're mocking dbtransation. suggest mock out login don't have worry any external dependencies in tests.
Comments
Post a Comment