mirror of
https://github.com/AlexMacocian/MTSC.git
synced 2026-07-24 03:56:32 +00:00
Added E2E test with query in URL
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using MTSC.Common.Http;
|
||||
using MTSC.Common.Http.RoutingModules;
|
||||
using MTSC.Server;
|
||||
using System.Web;
|
||||
|
||||
namespace MTSC.UnitTests
|
||||
{
|
||||
class TestQueryModule : IHttpRoute
|
||||
{
|
||||
HttpResponse IHttpRoute.HandleRequest(HttpRequest request, ClientData client, Server.Server server)
|
||||
{
|
||||
var query = HttpUtility.ParseQueryString(request.RequestQuery);
|
||||
if(query.Count == 2 &&
|
||||
query.Keys[0] == "key1" &&
|
||||
query.Keys[1] == "key2")
|
||||
{
|
||||
return new HttpResponse { StatusCode = HttpMessage.StatusCodes.OK };
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HttpResponse { StatusCode = HttpMessage.StatusCodes.BadRequest };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user