4 Commits
1.1.0 ... 1.2.0

Author SHA1 Message Date
Tommy Parnell
a1527c058c add path and query 2016-12-13 13:44:06 -05:00
Tommy Parnell
908d0e2433 target 45 2016-12-13 10:57:40 -05:00
Tommy Parnell
e9f3e5ed8b target 40 2016-12-06 07:48:41 -05:00
Tommy Parnell
8b053f0f77 minor doc comment 2016-11-12 16:58:01 -05:00
4 changed files with 26 additions and 5 deletions

View File

@@ -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()

View File

@@ -9,7 +9,7 @@
}, },
"frameworks": { "frameworks": {
"net461": {},
"netcoreapp1.0": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {

View File

@@ -22,6 +22,7 @@ namespace System
/// </summary> /// </summary>
/// <param name="bld"></param> /// <param name="bld"></param>
/// <param name="parameterDictionary"></param> /// <param name="parameterDictionary"></param>
/// <exception cref="ArgumentNullException"></exception>
/// <returns></returns> /// <returns></returns>
public static UriBuilder WithParameter(this UriBuilder bld, IDictionary<string, string> parameterDictionary) public static UriBuilder WithParameter(this UriBuilder bld, IDictionary<string, string> parameterDictionary)
{ {
@@ -126,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>

View File

@@ -14,15 +14,19 @@
"extension" "extension"
] ]
}, },
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"authors": [ "authors": [
"Tommy Parnell" "Tommy Parnell"
], ],
"frameworks": { "frameworks": {
"netstandard1.1": { "netstandard1.1": {
"imports": "dnxcore50",
"dependencies": {
"NETStandard.Library": "1.6.0"
}
},
"net40": {
"imports": "dnxcore50" "imports": "dnxcore50"
} },
"net45":{}
} }
} }