14 Commits
1.0.0 ... 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
Tommy Parnell
9b5bd3769f add author 2016-11-08 22:36:11 -05:00
Tommy Parnell
0b1b20f5df add author 2016-11-08 22:33:31 -05:00
Tommy Parnell
a15ad38a86 im dumb 2016-11-08 22:31:11 -05:00
Tommy Parnell
0a14c742e1 appveyor tag things 2016-11-08 22:29:21 -05:00
Tommy Parnell
103bab1eb7 readme 2016-11-08 22:26:52 -05:00
Tommy Parnell
e1817ab447 dont try to publish other packages 2016-11-08 22:26:03 -05:00
6 changed files with 31 additions and 18 deletions

View File

@@ -1,3 +1,8 @@
if($env:APPVEYOR_REPO_TAG -eq "true")
{
"do not publish coverall data on tag builds"
return
}
nuget install OpenCover -Version 4.6.519 -OutputDirectory tools
nuget install coveralls.net -Version 0.7.0 -OutputDirectory tools

View File

@@ -1,6 +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
@@ -28,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

@@ -4,7 +4,7 @@ nuget:
account_feed: true
project_feed: true
artifacts:
- path: '**\*.nupkg'
- path: 'src\**\*.nupkg'
init:
- git config --global core.autocrlf true
@@ -17,14 +17,14 @@ build_script:
- ps: dotnet restore
- ps: dotnet build -c Release .\src\UriBuilder.Fluent
- ps: dotnet build -c Release .\src\UriBuilder.Fluent.UnitTests
- ps: .\update-projectjson.ps1
- ps: dotnet restore
- ps: dotnet pack -c Release .\src\UriBuilder.Fluent
test_script:
- ps: dotnet test -c Release .\src\UriBuilder.Fluent.UnitTests
- ps: .\Coverage.ps1
- ps: .\update-projectjson.ps1
- ps: dotnet restore
- ps: dotnet pack -c Release .\src\UriBuilder.Fluent
deploy:
- provider: NuGet

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",
@@ -19,9 +17,11 @@
"dependencies": {
"NETStandard.Library": "1.6.0"
},
"authors": [
"Tommy Parnell"
],
"frameworks": {
"netstandard1.3": {
"netstandard1.1": {
"imports": "dnxcore50"
}
}