Mocking IDispossible with “Using”

Mocking objects is integral part of Unit Testing. The¬†nucleus¬†of Mocking is Dependency Injection, which allows us to inject Mock object into the code. But what happens when programmer has used the "Using" keyword ? For Example, This makes it difficult to mock DbCommand. The solution lies in deploying Factory Pattern to create our CustomDbCommand. For … Continue reading Mocking IDispossible with “Using”

Advertisements