I have a method I need to unit test, which as the subject implies, generates a NameValueCollection. All properties of the NVC are populated through form data:
private NameValueCollection generateCollection()
{
NameValueCollection nvc;
nvc = new NameValueCollection();
nvc.add("firstItem", HttpUtility.HtmlEncode(Request.Form["firstItem"]));
nvc.add("secondItem", HttpUtility.HtmlEncode(Request.Form["secondItem"]));
nvc.add("thirdItem", HttpUtility.HtmlEncode(Request.Form["thirdItem"]));
return nvc;
}
I am using the unit testing features included with visual studio. How the heck do I do this?