I'm currently testing my application and am stuck on trying to figure out how to create a custom fake URL referrer. I've tried to hard code it, but am getting an error that it is read-only. Here is what I've tried so far:
fakeController.HttpContext.Request.UrlReferrer.AbsolutePath = "http://www.yahoo.com";
as well as,
fakeController.Request.UrlReferrer = "http://www.yahoo.com";
I've searched the web for some ideas on how to create a fake/mock URL referrer for my fake controller, but have had no luck. Any suggestions are welcome.
Note: I'm using Visual Studios built-in unit testing facilities.
UPDATE:
Thank you all for your suggestions so far, I would be more than willing to use any other unit testing system outside of Visual Studio, unfortunately here at my work we are only allowed to use Visual Studio's built-in system, so I gotta work with what I've got. Thank you though, it's good to know these options are out there.