add path and query
This commit is contained in:
@@ -35,6 +35,17 @@ namespace FluentUriBuilder.Tests
|
|||||||
.WithParameter("awesome", "yodawg");
|
.WithParameter("awesome", "yodawg");
|
||||||
Assert.Equal("http://awesome.com/?awesome=yodawg", url.Uri.ToString());
|
Assert.Equal("http://awesome.com/?awesome=yodawg", url.Uri.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void PathAndQuery()
|
||||||
|
{
|
||||||
|
var url = new UriBuilder().WithPathSegment("/awesome/v1/").WithParameter("awesome", "cool").PathAndQuery();
|
||||||
|
Assert.Equal("/awesome/v1/?awesome=cool", url);
|
||||||
|
url = new UriBuilder().WithPathSegment("/awesome/v1").WithParameter("awesome", "cool").PathAndQuery();
|
||||||
|
Assert.Equal("/awesome/v1?awesome=cool", url);
|
||||||
|
url = new UriBuilder().WithPathSegment("/awesome/v1").PathAndQuery();
|
||||||
|
Assert.Equal("/awesome/v1", url);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TestAddParameterArray()
|
public void TestAddParameterArray()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net461": {},
|
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.NETCore.App": {
|
"Microsoft.NETCore.App": {
|
||||||
|
|||||||
@@ -127,6 +127,11 @@ namespace System
|
|||||||
return bld;
|
return bld;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string PathAndQuery(this UriBuilder bld)
|
||||||
|
{
|
||||||
|
return bld.Path + bld.Query;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use Https?
|
/// Use Https?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user