1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-14 09:52:53 +00:00

Added AppendPath method

This commit is contained in:
Jan Korf
2021-11-24 19:32:37 +01:00
parent 8b619e82f2
commit 9ebe5de825
5 changed files with 32 additions and 10 deletions
@@ -124,5 +124,18 @@ namespace CryptoExchange.Net.UnitTests
// assert
Assert.IsTrue(result == "http://test.api/1/path/test");
}
[TestCase("https://api.test.com/api", new[] { "path1", "path2" }, "https://api.test.com/api/path1/path2")]
[TestCase("https://api.test.com/api", new[] { "path1", "/path2" }, "https://api.test.com/api/path1/path2")]
[TestCase("https://api.test.com/api", new[] { "path1/", "path2" }, "https://api.test.com/api/path1/path2")]
[TestCase("https://api.test.com/api", new[] { "path1/", "/path2" }, "https://api.test.com/api/path1/path2")]
[TestCase("https://api.test.com/api/", new[] { "path1", "path2" }, "https://api.test.com/api/path1/path2")]
[TestCase("https://api.test.com", new[] { "test-path/test-path" }, "https://api.test.com/test-path/test-path")]
[TestCase("https://api.test.com/", new[] { "test-path/test-path" }, "https://api.test.com/test-path/test-path")]
public void AppendPathTests(string baseUrl, string[] path, string expected)
{
var result = baseUrl.AppendPath(path);
Assert.AreEqual(expected, result);
}
}
}