|
|
|
@ -103,5 +103,27 @@ namespace Squidex.Infrastructure |
|
|
|
|
|
|
|
Assert.Equal(value, value.WithFallback("fallback")); |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[InlineData("http://squidex.io/base/", "path/to/res", false, "http://squidex.io/base/path/to/res")] |
|
|
|
[InlineData("http://squidex.io/base/", "path/to/res", true, "http://squidex.io/base/path/to/res/")] |
|
|
|
[InlineData("http://squidex.io/base/", "/path/to/res", true, "http://squidex.io/base/path/to/res/")] |
|
|
|
public void Should_provide_full_url_without_query_or_fragment(string baseUrl, string path, bool trailingSlash, string output) |
|
|
|
{ |
|
|
|
var result = baseUrl.BuildFullUrl(path, trailingSlash); |
|
|
|
|
|
|
|
Assert.Equal(output, result); |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[InlineData("http://squidex.io/base/", "path/to/res?query=1", false, "http://squidex.io/base/path/to/res?query=1")] |
|
|
|
[InlineData("http://squidex.io/base/", "path/to/res#query=1", true, "http://squidex.io/base/path/to/res#query=1")] |
|
|
|
[InlineData("http://squidex.io/base/", "path/to/res;query=1", true, "http://squidex.io/base/path/to/res;query=1")] |
|
|
|
public void Should_provide_full_url_wit_query_or_fragment(string baseUrl, string path, bool trailingSlash, string output) |
|
|
|
{ |
|
|
|
var result = baseUrl.BuildFullUrl(path, trailingSlash); |
|
|
|
|
|
|
|
Assert.Equal(output, result); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|