Visual studio feeds

All Visual Studio blogs in one place


Enter your email address:

Delivered by FeedBurner

Increase your website traffic with



Anti-spam: How many eyes has a typical person?

Follow us on FB


Future mocking revisited

AddThis Social Bookmark Button
Previously , I have posted how it is possible to mock a method without passing the dependency through a constructor / calling method. This is something true for third party controls and tools where we have little control over how its created. You can find more on that in the following post:   Now the feature that lets you mock  members without passing the dependency, we call it Future mocking. However it does not mean that Justmock ignores the instance completely but rather there is a workflow where it checks if there is
no match for instance (of course it is a profiler intensive feature) and mocked within current context it tries to match any setup that is meant for. One of the best example that I recently encountered through a community feedback that describes a UI case where based on some action against the form, raises an event which needs to be handled in a specific way in the unit test to assert the expected value. Therefore, we have a Form class where the constructor looks something like:  
  public Form2() {...(Read whole news on source site)

Home : Blog List : Mehfuz's WebLog : Future mocking revisited