3 Commits
1.0.1 ... 1.0.2

Author SHA1 Message Date
Tommy Parnell
43bcbb3c30 add project url 2016-11-09 07:23:42 -05:00
Tommy Parnell
c66614c2fe finish up tests 2016-11-08 23:20:57 -05:00
Tommy Parnell
2885118175 add missing tests 2016-11-08 23:14:28 -05:00
4 changed files with 16 additions and 11 deletions

View File

@@ -29,7 +29,9 @@ new UriBuilder("https://awesome.com/yo)
.WithParameter("id", "5")
.ToString();
```
result: `https://awesome.com/yo?id=5`
result: `https://awesome.com/yo?id=5`
## Getting started
Just install the nuget package `install-package UriBuilder.Fluent` and thats it. The extension methods should be avalbile to you!

View File

@@ -97,6 +97,16 @@ namespace FluentUriBuilder.Tests
Assert.Equal(url.Host, "yodawg.com");
}
[Fact]
public void AddParamWithNoValue()
{
var url = new UriBuilder("http://awesome.com")
.WithParameter("awesome", "yodawg")
.WithParameter("fun", null)
.WithParameter("cool", string.Empty);
Assert.Equal("http://awesome.com/?awesome=yodawg&fun&cool", url.Uri.ToString());
}
[Fact]
public void TestAddTwoUrlParameters()
{

View File

@@ -51,11 +51,6 @@ namespace System
throw new ArgumentNullException(nameof(pathSegment));
}
var path = pathSegment.TrimStart('/');
if(string.IsNullOrWhiteSpace(bld.Path))
{
bld.Path = path;
return bld;
}
bld.Path = $"{bld.Path.TrimEnd('/')}/{path}";
return bld;
}

View File

@@ -4,9 +4,7 @@
"owners": [
"Tommy Parnell"
],
"repository": {
"url":"https://github.com/TerribleDev/UriBuilder.Fluent"
},
"projectUrl": "https://github.com/tparnell8/TurboLinks.Net",
"summary": "Fluent extensions for UriBuilder",
"tags": [
"Url building",