title: Fake object that is created by a method, not a constructor
body: <p>I am trying to unit test code that uses an API, so I am trying to decouple.</p>
  
  <p>I have created an interface for the "Application" class inside the API, which is sealed.</p>
  
  <p>I then created a class that uses the interface which has one method that returns an "Application" type object.</p>
  
  <p>Here is where I am having trouble, in my unit test I try to create an "Application" object to verify if the return value is correct. However the "Application" class does not have any constructors, nothing public or private(I checked with reflection). The object is created by calling static Application.Connect(AnotherTypeFromAPI arg), which returns an Application object.</p>
  
  <p>How do I return a fake object that I cannot create?</p>
  
  <pre><code>appMock.Connect(arg).Returns("How do I return an Application object here?"));
  </code></pre>
  
  <p>Or am I going about this the wrong way in regards to unit testing code that relies on an API? The entire API relies on the "Application" type so if I cannot fake it, I am not sure yet how I can stub or mock the other methods I need.</p>
  
  <p>I am using C#, NUnit, NSUbstitute.</p>