title: JustMock: Mocking Static method call not working
body: <p>Using JustMock:</p>
  
  <p>I am not sure why my arrange call for a static method is trying to execute the original.</p>
  
  <pre><code>[Test] 
  public void RunCompleteDivxJob_Negative_Exception()
  {
      DebugView.IsTraceEnabled = true;
      var mediaId = 2000999;
      var mediaTypeId = (int)CmtMediaType.Video;
      var queueCmtId = 9999;
      var cmtFileType = CmtFileType.SourceMediaFile;
      var statusError = CmtQueueStatus.Error;
      var exception = new Exception("test");
  
      // ARRANGE
      var encodeJobStateMachineManager = Mock.Create&lt;EncodeJobStateMachineManager&gt;(Behavior.CallOriginal);
      var logger = Mock.Create&lt;Logger&gt;(Behavior.CallOriginal, typeof(EncodeJobStateMachineManager));
      var inst = new PrivateAccessor(encodeJobStateMachineManager);
      inst.SetProperty("_log", logger);
      var createCompleteJobCalled = false;
      Mock.Arrange(() =&gt; DivxEncodeJob.CreateCompleteJob(mediaId, mediaTypeId, queueCmtId, cmtFileType))
      .DoInstead(() =&gt; createCompleteJobCalled = true);
      Mock.Arrange(() =&gt; encodeJobStateMachineManager.EncodeJob.Submit()).Throws(exception).MustBeCalled();
      logger.Arrange(x =&gt; x.Error(Arg.AnyString, exception)).MustBeCalled();
      //Mock.SetupStatic(typeof(QueueDAO));
      var updateQueueStatusCalled = false;
      Mock.Arrange(() =&gt; QueueDAO.UpdateQueueStatus(queueCmtId, statusError)).DoInstead(() =&gt;  updateQueueStatusCalled = true);
  
      // ACT
      encodeJobStateMachineManager.RunCompleteDivxJob(mediaId, mediaTypeId, queueCmtId, cmtFileType);
  
      // ASSERT
      Mock.Assert(encodeJobStateMachineManager);
      Assert.IsTrue(createCompleteJobCalled);
      Assert.IsTrue(updateQueueStatusCalled);
  }
  </code></pre>
  
  <p>The first static call is mocking the method call correctly:</p>
  
  <pre><code>Mock.Arrange(() =&gt; DivxEncodeJob.CreateCompleteJob(mediaId, mediaTypeId, queueCmtId, cmtFileType))
              .DoInstead(() =&gt; createCompleteJobCalled = true);
  </code></pre>
  
  <p>But the second static call is executing the original code:</p>
  
  <pre><code>Mock.Arrange(() =&gt; QueueDAO.UpdateQueueStatus(queueCmtId, statusError)).DoInstead(() =&gt; updateQueueStatusCalled = true);
  </code></pre>
  
  <p>These are essentially called exactly the same.  So why is the first one working as expected and the second not?</p>