Development, Testing

Mocking internal interfaces

Yesterday I’ve worked on connector library used to access data warehouses provided by two external vendors. In order for it to be easy to use I limited public members to:

  • library interface – can be used to aggregate connectors and testing
  • two connector classes that that provide public methods to retrieve prepared responses
  • DTO request and response classes

Continue reading

Standard
Development, Testing

Mock – my favourite mock engine

When I try to unit test class one of the most important things is to eliminate all dependencies and replace them with proper mocks. Such mocks allow me to fully control inputs that object will access and verify that proper methods have been called.

Recently I’ve written one business logic class that manages┬áSPA (Single Page Application) and uses four different repositories from which it pulls data and presents them as Web API.

Continue reading

Standard
Development, Testing

NCrunch – A plugin that makes TDD sexy

Before I started working at my current job I’ve never seen continuous testing tools. For me running unit test, despite being really useful, was a chore that I would do after modifying several files and (usually) writing few additional tests.

It shouldn’t come as a surprise, that several of them will be failing, enabling me to do what developers like the most – fixing errors in their code or, even more fun, fixing errors in somebody else’s code.

Continue reading

Standard