One of my methods in an NUnit test checks a Session-State variable :
if (Sesssion[variableName] == null) ...
and the NUnit test is failing with err:
System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.
I tried taking the test method out of a class library and putting it into the codebehind cs of an aspx page that set EnableSessionState="True" in the aspx page directive. Added a web config with sessionState mode = "InProc" in the web config, then tried < pages enableSessionState ="true"/> in the web.config.
Nunit tests still failed on the session state action.
Do I have to mock these out?