Test system result = ... checks the value of the result, not the type of result.
The errormessage error is misleading, since type.ToString () and object.ToString () also lead to messge
Override the myTpe.ToString () method and the error will be
Expected: <mytype>
But was: {your ToString() result goes here}
(nunit 2.5.7)
[TestCase(12, Result = "0")]
public String GetById(int id)
{
return "0";
}
[TestCase(12, Result = typeof(mytype))]
public System.Type GetByIdType(int id)
{
return typeof(mytype);
}