Question: I have some production code like

```
private bool IsTypeEqual(object theFirstObject, object theSecondObject)
{
       if(theFirstObject.GetType()==theSecondObject.GetType())
       {
               return true;
       }
       else
       {
                return false;
       }
}

```

Now i have to write the unit test case for this code. I am using NMock to create the 
object. So when i am passing the object of two different classes it should go to else part.
But actually as i am mocking both the objects, so GetType() returning the MockObject type for both of the object. How can i solve this problem.

Answer: 
You dont need to mock "theFirstObject" or "theSecondObject". You really dont care what happens to these classes, you just need to assert the result is correct. 

If I were you I would pass in different type and assert whether it is true/false:

```
Assert.AreEqual(false, IsTypeEqual("HelloWorld", 192));

Assert.AreEqual(true, IsTypeEqual("Hello", "World"));

```
I hope this code will help you.

```
private bool IsTypeEqual<TMockedType>(object theFirstObject, object theSecondObject)
{
    Matcher matcher = Is.TypeOf(typeof(TMockedType));

    return matcher.Matches(theFirstObject) && matcher.Matches(theSecondObject);
}
```