mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
0391371a8c
* Bump NUnit from 3.13.3 to 4.0.0 Bumps [NUnit](https://github.com/nunit/nunit) from 3.13.3 to 4.0.0. - [Release notes](https://github.com/nunit/nunit/releases) - [Changelog](https://github.com/nunit/nunit/blob/master/CHANGES.md) - [Commits](https://github.com/nunit/nunit/compare/v3.13.3...v4.0.0) --- updated-dependencies: - dependency-name: NUnit dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * update tests to nunit 4.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jonas Dellinger <jonas@dellinger.dev>
52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using NUnit.Framework;
|
|
|
|
namespace SpotifyAPI.Web.Tests
|
|
{
|
|
[TestFixture]
|
|
public class URIExtensionTest
|
|
{
|
|
[Test]
|
|
public void ApplyParameters_WithoutExistingParameters()
|
|
{
|
|
var expected = "http://google.com/?hello=world&nice=day";
|
|
var uri = new Uri("http://google.com/");
|
|
|
|
var parameters = new Dictionary<string, string>
|
|
{
|
|
{ "hello", "world" },
|
|
{ "nice", "day" }
|
|
};
|
|
Assert.That(expected, Is.EqualTo(uri.ApplyParameters(parameters).ToString()));
|
|
}
|
|
|
|
[Test]
|
|
public void ApplyParameters_WithExistingParameters()
|
|
{
|
|
var expected = "http://google.com/?existing=paramter&hello=world&nice=day";
|
|
var uri = new Uri("http://google.com/?existing=paramter");
|
|
|
|
var parameters = new Dictionary<string, string>
|
|
{
|
|
{ "hello", "world" },
|
|
{ "nice", "day" }
|
|
};
|
|
Assert.That(expected, Is.EqualTo(uri.ApplyParameters(parameters).ToString()));
|
|
}
|
|
|
|
[Test]
|
|
public void ApplyParameters_HandlesEscape()
|
|
{
|
|
var expected = "http://google.com/?existing=paramter&hello=%26world++";
|
|
var uri = new Uri("http://google.com/?existing=paramter");
|
|
|
|
var parameters = new Dictionary<string, string>
|
|
{
|
|
{ "hello", "&world " },
|
|
};
|
|
Assert.That(expected, Is.EqualTo(uri.ApplyParameters(parameters).ToString()));
|
|
}
|
|
}
|
|
}
|