8 Commits
1.0.1 ... 1.0.4

Author SHA1 Message Date
Tommy Parnell
91579a1700 fix nuget package url 2016-11-09 09:35:56 -05:00
Tommy Parnell
d6c78f2193 retarget to 4.5 2016-11-09 09:32:44 -05:00
Tommy Parnell
dbb9f5b404 english 2016-11-09 07:28:29 -05:00
Tommy Parnell
5bfe876f57 add comma 2016-11-09 07:28:08 -05:00
Tommy Parnell
6a31a1968e readme 2016-11-09 07:27:32 -05:00
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 18 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
## UriBuilder.Fluent
[![Coverage Status](https://coveralls.io/repos/github/TerribleDev/UriBuilder.Fluent/badge.svg)](https://coveralls.io/github/TerribleDev/UriBuilder.Fluent) [![Build status](https://ci.appveyor.com/api/projects/status/cp704w3bgaerufxm/branch/master?svg=true)](https://ci.appveyor.com/project/tparnell8/uribuilder-fluent/branch/master)
This places extension methods over System.UriBuilder to help deal with query string parameters, and create more of a fluent interface. Unlike other projects this builds ontop of trusty UriBuilder, and does not use custom Uri generators, or have outside dependencies.
This places extension methods over System.UriBuilder to help deal with query string parameters, and create more of a fluent interface. Unlike other projects, this NetStandardLibrary compliant package builds ontop of trusty UriBuilder, does not use custom Uri generators, or have outside dependencies. Unit tests continue to be a first class citizen!
This lets you do things like
@@ -29,7 +29,9 @@ new UriBuilder("https://awesome.com/yo)
.WithParameter("id", "5")
.ToString();
```
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 available 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/TerribleDev/UriBuilder.Fluent",
"summary": "Fluent extensions for UriBuilder",
"tags": [
"Url building",
@@ -23,7 +21,7 @@
"Tommy Parnell"
],
"frameworks": {
"netstandard1.3": {
"netstandard1.1": {
"imports": "dnxcore50"
}
}