I have an mvc application .I need to write unit test cases for that application. In controllers of this application i m reading an object from session
objectclass Obj = (objectclass)Session["Object"];
I need to fake this reading of object using Shims/Stubs .
You can create a method to access session data and mock the same like this. Create an interface.
Now you can mock away the method call using any mocking framework.
Replace you seesion access code with