Testing HttpRequest.Form Variables in Unit Tests for ASP.NET Core Components

added by DotNetKicks
9/19/2022 3:28:28 PM

148 Views

Here's a quick post I'm leaving here as a note to self on how to create an HttpContext and associated Request.Form collection that can be tested in a Unit test. While working on a small helper component ( FormVariableBinder and related Tests) I needed to set up a test to retrieve Request.Form variables to verify my binder is working.


0 comments