finish up tests
This commit is contained in:
@@ -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 avalbile to you!
|
||||
@@ -102,8 +102,9 @@ namespace FluentUriBuilder.Tests
|
||||
{
|
||||
var url = new UriBuilder("http://awesome.com")
|
||||
.WithParameter("awesome", "yodawg")
|
||||
.WithParameter("fun", null);
|
||||
Assert.Equal("http://awesome.com/?awesome=yodawg&fun", url.Uri.ToString());
|
||||
.WithParameter("fun", null)
|
||||
.WithParameter("cool", string.Empty);
|
||||
Assert.Equal("http://awesome.com/?awesome=yodawg&fun&cool", url.Uri.ToString());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user