title: Understanding stubs, fakes and mocks.
body: <p>I have just started to read <a href="https://rads.stackoverflow.com/amzn/click/com/047064320X" rel="noreferrer" rel="nofollow noreferrer">Professional Test Driven Development with C#: Developing Real World Applications with TDD </a></p>
  
  <p>I have a hard time understanding stubs, fakes and mocks. From what I understand so far, they are fake objects used for the purpose of unit testing your projects, and that a mock is a stub with conditional logic into it.</p>
  
  <p>Another thing I think I have picked up is that mocks are somehow related with dependency injection, a concept which I only managed to understand yesterday.</p>
  
  <p>What I do not get is why I would actually use them. I cannot seem to find any concrete examples online that explains them properly.</p>
  
  <p>Can anyone please explain to me this concepts?</p>