The below test will fail with null reference exception:
public enum Country
{
Antartica
}
[Test, Isolated]
public void BigCountry()
{
Isolate.WhenCalled(()=>Enum.GetNames(typeof(Country))).WillReturn(new[]{"A"});
}
The exception is
TestCase 'BigCountry' failed: System.NullReferenceException : Object reference not set to an instance of an object.
at c9.a(et A_0)
at c9.a(Object A_0)
C:Documents and SettingsSoon Hui.ESTEEMSOFTMy Documentsjobs hird party components ypemockEnumMockEnumMockEnumMockCountryTest.cs(23,0): at EnumMock.CountryTest.BigCountry()
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
C:Documents and SettingsSoon Hui.ESTEEMSOFTMy Documentsjobs hird party components ypemockEnumMockEnumMockEnumMockCountryTest.cs(20,0): at EnumMock.CountryTest.BigCountry()
I think this is pretty unclear; it should be TypeMockException, rather than a null reference exception.
________
Babi mac proved that