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
0 votes
I just upgraded to the newest version of TypeMock.
I just converted my solution to VSTS 2008.

I am getting the following test failure mesage:
Test method CarsContentModule.Test.ApplicationClickHandlerTest.ApplicationClickHandlerAssignQueryStringValuesTest threw exception: 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..

Here is the code that is throwing the Exception:
MockObject mockHttpContext = MockManager.MockObject(typeof(HttpContext));


I cannot determine why this would cause this problem; before conversion and upgrade the test passed. Can anyone help?
asked by csustek (4k points)

1 Answer

0 votes
Hi,

In general there are some differences between 2008 and 2005 when dealing with system classes. This may have made a defect show itself.

In any case on its own this statement does not cause any problem. (at least not on our machines).
In order to locate the issue, I would start by preparing a new test that contains only this statement and see if it fails also (most likely it wont).
Then I would try to run only the original test and see if when run alone it fails also.
If it does please post the test code here so we can understand if not let me know we might need to see what other tests are effecting this.
answered by lior (13.2k points)
...