mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 16:06:15 +00:00
Updated some testing code
This commit is contained in:
parent
94d8afe149
commit
99e4f96f63
@ -375,7 +375,8 @@ namespace CryptoExchange.Net.Testing.Comparers
|
|||||||
}
|
}
|
||||||
else if (objectValue is DateTime time)
|
else if (objectValue is DateTime time)
|
||||||
{
|
{
|
||||||
if (time != DateTimeConverter.ParseFromString(jsonValue.Value<string>()!))
|
var jsonStr = jsonValue.Value<string>()!;
|
||||||
|
if (!string.IsNullOrEmpty(jsonStr) && time != DateTimeConverter.ParseFromString(jsonStr))
|
||||||
throw new Exception($"{method}: {property} not equal: {jsonValue.Value<string>()} vs {time}");
|
throw new Exception($"{method}: {property} not equal: {jsonValue.Value<string>()} vs {time}");
|
||||||
}
|
}
|
||||||
else if (objectValue is bool bl)
|
else if (objectValue is bool bl)
|
||||||
|
@ -173,17 +173,20 @@ namespace CryptoExchange.Net.Testing
|
|||||||
|
|
||||||
foreach (var clientInterface in clientInterfaces)
|
foreach (var clientInterface in clientInterfaces)
|
||||||
{
|
{
|
||||||
var implementation = assembly.GetTypes().Single(t => clientInterface.IsAssignableFrom(t) && t != clientInterface);
|
var implementations = assembly.GetTypes().Where(t => clientInterface.IsAssignableFrom(t) && t != clientInterface);
|
||||||
int methods = 0;
|
foreach (var implementation in implementations)
|
||||||
foreach (var method in implementation.GetMethods().Where(m => implementationTypes.IsAssignableFrom(m.ReturnType)))
|
|
||||||
{
|
{
|
||||||
var interfaceMethod = clientInterface.GetMethod(method.Name, method.GetParameters().Select(p => p.ParameterType).ToArray());
|
int methods = 0;
|
||||||
if (interfaceMethod == null)
|
foreach (var method in implementation.GetMethods().Where(m => implementationTypes.IsAssignableFrom(m.ReturnType)))
|
||||||
throw new Exception($"Missing interface for method {method.Name} in {implementation.Name} implementing interface {clientInterface.Name}");
|
{
|
||||||
methods++;
|
var interfaceMethod = clientInterface.GetMethod(method.Name, method.GetParameters().Select(p => p.ParameterType).ToArray());
|
||||||
}
|
if (interfaceMethod == null)
|
||||||
|
throw new Exception($"Missing interface for method {method.Name} in {implementation.Name} implementing interface {clientInterface.Name}");
|
||||||
|
methods++;
|
||||||
|
}
|
||||||
|
|
||||||
Debug.WriteLine($"{clientInterface.Name} {methods} methods validated");
|
Debug.WriteLine($"{clientInterface.Name} {methods} methods validated");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user