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
Hello,

I am using HttpContext.Current.Session["SessionUser"] to save user session for browser.
This works fine when I debug the code.

My problem is that, It is not working when I run the unit test for a controller method which make use of this "HttpContext.Current.Session["SessionUser"]". It saves that HttpContext does not exists in current context.

How to make unit test run for HttpContext.Current.Session["SessionUser"]?
asked by sudhir (3.5k points)

1 Answer

0 votes
Hi Sudhir,

Can you post the code under test and the error you are getting when trying to test it? It would make recreating this a lot easier...

Also, you should check out Ivonna - an addon to Isolator aimed at unit testing ASP.NET. You can find it on our add-ons page: https://www.typemock.com/add-ons.

Doron
Typemock Support
answered by doron (17.2k points)
...