1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-23 22:32:57 +00:00

Updated some testing code

This commit is contained in:
Jkorf
2024-11-27 13:07:26 +01:00
parent 94d8afe149
commit 99e4f96f63
2 changed files with 14 additions and 10 deletions
@@ -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)
+4 -1
View File
@@ -173,7 +173,9 @@ 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);
foreach (var implementation in implementations)
{
int methods = 0; int methods = 0;
foreach (var method in implementation.GetMethods().Where(m => implementationTypes.IsAssignableFrom(m.ReturnType))) foreach (var method in implementation.GetMethods().Where(m => implementationTypes.IsAssignableFrom(m.ReturnType)))
{ {
@@ -187,4 +189,5 @@ namespace CryptoExchange.Net.Testing
} }
} }
} }
}
} }