mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-09-02 21:51:27 +00:00
Fixed test
This commit is contained in:
parent
f2753aed1e
commit
6156fb8154
@ -128,12 +128,7 @@ namespace CryptoExchange.Net.Testing
|
|||||||
var uriParams = client.ParameterPositions[method] == HttpMethodParameterPosition.InUri ? client.CreateParameterDictionary(parameters) : null;
|
var uriParams = client.ParameterPositions[method] == HttpMethodParameterPosition.InUri ? client.CreateParameterDictionary(parameters) : null;
|
||||||
var bodyParams = client.ParameterPositions[method] == HttpMethodParameterPosition.InBody ? client.CreateParameterDictionary(parameters) : null;
|
var bodyParams = client.ParameterPositions[method] == HttpMethodParameterPosition.InBody ? client.CreateParameterDictionary(parameters) : null;
|
||||||
|
|
||||||
var headers = new Dictionary<string, string>();
|
var requestDefinition = new RestRequestConfiguration(
|
||||||
|
|
||||||
authProvider.TimeProvider = new TestAuthTimeProvider(time ?? new DateTime(2024, 01, 01, 0, 0, 0, DateTimeKind.Utc));
|
|
||||||
authProvider.ProcessRequest(
|
|
||||||
client,
|
|
||||||
new RestRequestConfiguration(
|
|
||||||
new RequestDefinition(path, method)
|
new RequestDefinition(path, method)
|
||||||
{
|
{
|
||||||
Authenticated = true
|
Authenticated = true
|
||||||
@ -141,14 +136,19 @@ namespace CryptoExchange.Net.Testing
|
|||||||
host,
|
host,
|
||||||
uriParams ?? new Dictionary<string, object>(),
|
uriParams ?? new Dictionary<string, object>(),
|
||||||
bodyParams ?? new Dictionary<string, object>(),
|
bodyParams ?? new Dictionary<string, object>(),
|
||||||
headers,
|
new Dictionary<string, string>(),
|
||||||
client.ArraySerialization,
|
client.ArraySerialization,
|
||||||
client.ParameterPositions[method],
|
client.ParameterPositions[method],
|
||||||
client.RequestBodyFormat
|
client.RequestBodyFormat
|
||||||
)
|
);
|
||||||
|
|
||||||
|
authProvider.TimeProvider = new TestAuthTimeProvider(time ?? new DateTime(2024, 01, 01, 0, 0, 0, DateTimeKind.Utc));
|
||||||
|
authProvider.ProcessRequest(
|
||||||
|
client,
|
||||||
|
requestDefinition
|
||||||
);
|
);
|
||||||
|
|
||||||
var signature = getSignature(uriParams, bodyParams, headers);
|
var signature = getSignature(requestDefinition.QueryParameters, requestDefinition.BodyParameters, requestDefinition.Headers);
|
||||||
|
|
||||||
if (!string.Equals(signature, expectedSignature, compareCase ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(signature, expectedSignature, compareCase ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase))
|
||||||
throw new Exception($"Signatures do not match. Expected: {expectedSignature}, Actual: {signature}");
|
throw new Exception($"Signatures do not match. Expected: {expectedSignature}, Actual: {signature}");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user