title: How to moq a static class with a static method (UnitOfWork case)?
body: <p>I have these classes:</p>
  
  <pre><code>public static class UnitOfWorkSS 
  {
    public static IUnitOfWork Begin()
    {
      return IoC.Resolve&lt;IUnitOfWork&gt;();
    }
  }
  
  public class PostService
  {
    using (IUnitOfWork unitOfWork = UnitOfWorkSS.Begin())
    {
      //don't forget to sanitize html content
      htmlContent = _htmlSanitizer.Sanitize(htmlContent);
  
      IPost post = _factory.CreatePost(byUser, title, htmlContent);                    
  
      _postRepository.Add(post);
  
      unitOfWork.Commit();
    }
  }
  </code></pre>
  
  <p>How can I mock the classes <code>UnitOfWorkSS</code> and <code>unitOfWork</code>?</p>