title: XUnit how to unit test business object and should I be mocking everything?
body: <p>I am trying to Unit Test (XUnit) my business object where it takes 2 parameters and do some operation before returning an output. </p>
  
  <pre><code>    public OutPutModel MyBusinessObject(InputModel1 obj1, InputModel2 obj2)
      {
          // Performing some actions here including seding a call
          // to the data access layer to perform some db operation.
          return outPutModel;
      }
  </code></pre>
  
  <p>In my XUnit I am doing the following </p>
  
  <pre><code>    [Fact]
      public void MyBusinessObject_ReturnsOutPutModel()
      {
          var businessObjectMock = new Mock&lt;IBusinessObject&gt;();
          var obj1 = new Mock&lt;InputModel1&gt;();
          var obj2 = new Mock&lt;InputModel2&gt;();
  
          var outPutModel = new OutPutModel();
  
          var result = businessObjectMock.Setup(x =&gt; x.MyBusinessObject(obj1.Object, obj2.Object)).Returns(outPutModel);
  
          result.Equals(outPutModel);
      }
  </code></pre>
  
  <p>Now, I have a break point set in my Business Object (public OutPutModel MyBusinessObject(InputModel1 obj1, InputModel2 obj2)). Upon running the test, it don't hit the break point but still passing the test. Am, I doing something wrong here? Should I be mocking everything including the business object interface or just mock the parameter objects and call a new instance of business object? 
  P.S. Forgot to mention, I am aware the factor that it is not a good idea of having db level stuff in business objects. Unfortunately, just consider I don't have a choice.</p>