Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

System.NullReferenceException when running with isolator V7
dhelper
#1 Posted : Sunday, April 29, 2012 4:15:36 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2012(UTC)
Posts: 3

Was thanked: 1 time(s) in 1 post(s)
Test uses NUnit and Isolator V7. Pass when run using Resharper but fails with nCrunch

System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> System.NullReferenceException : Object reference not set to an instance of an object.
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at gs.c()
at dj.a(Boolean A_0)
at dp.b(Boolean A_0)
at i1.b(Boolean A_0)
at i1.a(Object A_0, Boolean A_1, Func`1 A_2, Action A_3, Action A_4, Action A_5)
at i1.b(Object A_0)
at TypeMock.ArrangeActAssert.ExpectationEngine`1.a(TResult A_0)
at ...
Remco
#2 Posted : Sunday, April 29, 2012 9:54:47 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi, thanks for sharing this issue.

Are you able to share any code from the test? If you're able to show the test record/expectations this may help highlight the the issue.

Also, can you confirm whether you're running the latest version of Isolator V7? The first release of Isolator V7 had some issues with NCrunch.


Cheers,

Remco
dhelper
#3 Posted : Monday, April 30, 2012 5:58:58 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2012(UTC)
Posts: 3

Was thanked: 1 time(s) in 1 post(s)
The test fails on a line that looks like this:
[Test, Isolated]
public void MyTest()
{
const string sessionId = "session-1";
Isolate.WhenCalled(() => OperationContext.Current.SessionId).WillReturn(sessionId); // <-- fail here

The code fails before it even reach my class under test
Remco
#4 Posted : Monday, April 30, 2012 10:39:32 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Thanks - that's very useful. Are you able to share which precise version of Isolator you're using? I'll look into the problem here and will try to reproduce it.
dhelper
#5 Posted : Monday, April 30, 2012 12:12:14 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/29/2012(UTC)
Posts: 3

Was thanked: 1 time(s) in 1 post(s)
I'm tried using 7.0.4but I think it would happen with the latest 7.0.5 as well.
1 user thanked dhelper for this useful post.
Remco on 4/30/2012(UTC)
Remco
#6 Posted : Sunday, May 20, 2012 11:30:17 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
An update on this: I'm currently working with members of the Isolator team to identify why this issue is occurring. Hopefully I'll have more details to share soon.
binygal
#7 Posted : Wednesday, August 15, 2012 7:47:14 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/15/2012(UTC)
Posts: 5

I've got the same issue, Is there any new data or hack to share?
Remco
#8 Posted : Wednesday, August 15, 2012 10:29:15 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Sadly I still haven't heard back from the Isolator team. It's starting to look like NCrunch's support for Isolator may just end with V6.
binygal
#9 Posted : Saturday, August 25, 2012 6:21:23 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 8/15/2012(UTC)
Posts: 5

Solved - Upgrading to Isolatror v. 7.0.9 solved this issue.
Remco
#10 Posted : Saturday, August 25, 2012 10:52:43 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Excellent news! Thanks for sharing!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.059 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download