chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
My company recently renewed our maintenance license and so I updated Isolator from version to version It broke a test that fakes a LINQ-to-SQL data context. The problem seems to be faking a Table<T>, since the simple test below throws an exception. I have been unable to work around the issue.

public void FakeTable()
    var fakeTable = Isolate.Fake.Instance<System.Data.Linq.Table<object>>();
    fakeTable.DeleteAllOnSubmit(new object[0]);

Full exception details:

Test method MySolution.MyTests.FakeTable threw exception: 
System.NullReferenceException: Object reference not set to an instance of an object.
at jd.c()
at fh.b(MethodBase A_0, Object[] A_1, TypeParams A_2)
at ip.a(String A_0, Object[] A_1, Object A_2, Object A_3, String A_4, Type A_5, MethodBase A_6)
at do.a(String A_0, Object A_1, MethodBase A_2, Object[] A_3, Object A_4, String A_5, ip A_6)
at do.a(Object A_0, String A_1, String A_2, MethodBase A_3, Object[] A_4, Object A_5)
at System.Data.Linq.Table`1.DeleteAllOnSubmit(IEnumerable`1 entities)
at TestCoreInterface.ServicesTests.FakeTable() in ServicesTests.cs: line 363
at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Boolean A_5, Object[] A_6)
at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected, Boolean isInterceptedType)
at MySolution.MyTests.FakeTable() in MyTests.cs: line 361

asked by allon.guralnek (10.6k points)

4 Answers

0 votes
Hi Allon,
We are looking into this, and get back to you asap.
answered by yoel (1.9k points)
0 votes
You uncovered a bug regarding a generic method argument that is constrained to a generic class argument.
We are preparing a fix for this and it should be ready next week.
answered by yoel (1.9k points)
0 votes
Any progress on the fix for this?
answered by allon.guralnek (10.6k points)
0 votes
Hi Allon,

Sorry for the delay.
The version with the fix will be released at beginning of next week.
answered by ohad (35.4k points)