1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 16:32:57 +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);
}
}
}
@@ -116,7 +116,7 @@ namespace CryptoExchange.Net.UnitTests
// assert
Assert.IsTrue(client.ClientOptions.BaseAddress == "http://test.address.com/");
Assert.IsTrue(client.ClientOptions.BaseAddress == "http://test.address.com");
Assert.IsTrue(client.ClientOptions.RateLimiters.Count == 1);
Assert.IsTrue(client.ClientOptions.RateLimitingBehaviour == RateLimitingBehaviour.Fail);
Assert.IsTrue(client.ClientOptions.RequestTimeout == TimeSpan.FromMinutes(1));
@@ -25,7 +25,7 @@ namespace CryptoExchange.Net.UnitTests
//assert
Assert.IsTrue(client.ClientOptions.BaseAddress == "http://test.address.com/");
Assert.IsTrue(client.ClientOptions.BaseAddress == "http://test.address.com");
Assert.IsTrue(client.ClientOptions.ReconnectInterval.TotalSeconds == 6);
}