I am attempting to test some code that uses Request.Item(“key”) but I can not find a way to fill out this property because it is read-only. I am mocking out the httpcontext and have gotten the querystring, cookies, form, and ServerVariables collections filled out, but during debug the Request.Item collection returns nothing everytime. I heard somewhere that it may be a save order issue. Thanks for any help, Nick
Edit:
So the Search Order was what I was told might be the issue, but since they are all filled out, I’m not convinced this is the issue.
Here is a link to that idea:
Search order of HttpRequest indexer
Issue was fixed by overriding the items collection in a Request class inheriting from httprequestbase. It was overridden in the Session class inheriting from httpsessionbase but that only covered Session.Items, not Request.Items