fixed some tests
This commit is contained in:
parent
124d86cb0f
commit
0570a1d03b
@ -33,7 +33,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\Flurl\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
@ -47,15 +47,15 @@
|
||||
<Compile Include="UrlBuilderTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Flurl\Flurl.csproj">
|
||||
<Project>{70a34167-759e-4902-82e0-e6a84c2ce46f}</Project>
|
||||
<Name>Flurl</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
@ -100,9 +100,9 @@ namespace Flurl.Test
|
||||
.AddQueryParams(new { a = 1, b = 2, c = 999 })
|
||||
.AppendPathSegment("category")
|
||||
.RemoveQueryParam("c")
|
||||
.AddQueryParam("z", 55)
|
||||
.SetQueryParam("z", 55)
|
||||
.RemoveQueryParams("a", "z")
|
||||
.AddQueryParams(new { n = "hi", m = "bye" })
|
||||
.SetQueryParams(new { n = "hi", m = "bye" })
|
||||
.AppendPathSegment("endpoint");
|
||||
|
||||
Assert.AreEqual("http://www.mysite.com/category/endpoint?b=2&n=hi&m=bye", url.ToString());
|
||||
@ -123,7 +123,13 @@ namespace Flurl.Test
|
||||
[Test]
|
||||
public void encodes_query_params() {
|
||||
var url = "http://www.mysite.com".AddQueryParams(new { x = "$50", y = "2+2=4" });
|
||||
Assert.AreEqual("http://www.mysite.com?x=%2450&y=2%2b2%3d4", url.ToString());
|
||||
Assert.AreEqual("http://www.mysite.com?x=%2450&y=2%2b2%3d4", url.ToString());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void combine_works() {
|
||||
var url = Url.Combine("http://www.foo.com/", "/too/", "/many/", "/slashes/", "too", "few");
|
||||
Assert.AreEqual("http://www.foo.com/too/many/slashes/too/few", url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user