Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to create a unit test for a controller which redirects to a URL.

What I have tried:

C#
public IHttpActionResult RedirectMethod(FormDataCollection collection)
{
...
...
...
...
 var url = new Uri(redirectUrl, UriKind.Relative);
 return Redirect(url)
}
Posted
Updated 20-Feb-19 8:13am
v4

1 solution

Take a look at these test frameworks: https://www.slant.co/topics/10642/~frameworks-to-test-rest-server[^]

Insomnia looks very promising and can generate code in C# and other languages: https://www.slant.co/topics/7913/viewpoints/4/~rest-api-clients~insomnia[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900