title: How to properly unit test a domain service?
body: <p>I have a domain service</p>
  
  <pre><code>public class BlobService{
      private FooRepository repo;
      public BlobService(FooRepository repo){
          this.repo = repo;
      }
      public void DoSomething(int id1,int id2){
          var foo1 = repo.Get(id1);
          var foo2 = repo.Get(id2);
          var valueSomething = foo1.GetValueSomething();
          foo2.SetValueSomething(valueSomething );
          repo.Save(foo2);
          DomainEvent.Raise(new ValueSomethingChanged(foo2));
      }
  }
  </code></pre>
  
  <p>Here , the methods </p>
  
  <ul>
  <li>repo.Get, repo.Save are tested by integration test (because there is a rdbms behind)</li>
  <li>GetValueSomething , SetValueSomething and Raise by unit tests</li>
  </ul>
  
  <p>So what will my unit test for BlobService look like ?</p>
  
  <ul>
  <li>Mocking repo, foo1 and foo2 and checking the good methods are called. DomainEvent is static but really simple</li>
  <li>do integration test instead : send real implementation for repo, request it and check the foo2 value.</li>
  <li>something else</li>
  </ul>
  
  <p>?</p>