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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -