Skip to content

Commit

Permalink
Add path info decoding test
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed May 9, 2018
1 parent 53059e4 commit ce3e5f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/ServiceStack.WebHost.Endpoints.Tests/Config.cs
Expand Up @@ -6,6 +6,10 @@ public class Config
{
public static readonly string ServiceStackBaseUri = Environment.GetEnvironmentVariable("CI_BASEURI") ?? "http://localhost:20000";
public static readonly string AbsoluteBaseUri = ServiceStackBaseUri + "/";

public static readonly string HostNameBaseUrl = "http://DESKTOP-BCS76J0:20000/"; //Allow fiddler
public static readonly string AnyHostBaseUrl = "http://*:20000/"; //Allow capturing by fiddler

public static readonly string ListeningOn = ServiceStackBaseUri + "/";
public static readonly string RabbitMQConnString = Environment.GetEnvironmentVariable("CI_RABBITMQ") ?? "localhost";
public static readonly string SqlServerConnString = Environment.GetEnvironmentVariable("CI_SQLSERVER") ?? "Server=localhost;Database=test;User Id=test;Password=test;";
Expand Down
16 changes: 15 additions & 1 deletion tests/ServiceStack.WebHost.Endpoints.Tests/RouteTests.cs
Expand Up @@ -285,7 +285,6 @@ public void Can_create_request_DTO_from_URL()
var response = (HelloResponse)HostContext.AppHost.GetServiceGateway(new BasicRequest()).Send(responseType, request);
Assert.That(response.Result, Is.EqualTo("Hello, gateway"));
}

}

public class RouteAppHost : AppHostHttpListenerBase
Expand Down Expand Up @@ -371,6 +370,7 @@ public void TestFixtureSetUp()
appHost = new ModifiedRouteAppHost();
appHost.Init();
appHost.Start(Config.AbsoluteBaseUri);
// appHost.Start(Config.AnyHostBaseUrl); //go through fiddler
}

[OneTimeTearDown]
Expand All @@ -379,6 +379,20 @@ public void TestFixtureTearDown()
appHost.Dispose();
}

[Test]
public void Does_URL_Decode_PathInfo()
{
var client = new JsonServiceClient(Config.HostNameBaseUrl);
// var client = new JsonServiceClient("http://test.servicestack.net");

var pathInfo = "ern::Closer2U::Userprofile::1c7e9ead-c7d9-46f8-a0cc-2777c4373ac4";
var response = client.Get(new CustomRoute {
Data = pathInfo
});

Assert.That(response.Data, Is.EqualTo(pathInfo));
}

[Test]
public void Can_download_modified_routes()
{
Expand Down

0 comments on commit ce3e5f8

Please sign in to comment.