mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 00:16:27 +00:00
Small test fixes
This commit is contained in:
parent
87b0c8d7a2
commit
e3fece41f3
@ -151,7 +151,12 @@ namespace CryptoExchange.Net.Testing.Comparers
|
|||||||
|
|
||||||
private static void CheckObject(string method, JProperty prop, object obj, List<string>? ignoreProperties)
|
private static void CheckObject(string method, JProperty prop, object obj, List<string>? ignoreProperties)
|
||||||
{
|
{
|
||||||
var resultProperties = obj.GetType().GetProperties().Select(p => (p, ((JsonPropertyNameAttribute?)p.GetCustomAttributes(typeof(JsonPropertyNameAttribute), true).SingleOrDefault())?.Name));
|
var resultProperties = obj.GetType().GetProperties(
|
||||||
|
System.Reflection.BindingFlags.Public
|
||||||
|
| System.Reflection.BindingFlags.NonPublic
|
||||||
|
| System.Reflection.BindingFlags.GetProperty
|
||||||
|
| System.Reflection.BindingFlags.SetProperty
|
||||||
|
| System.Reflection.BindingFlags.Instance).Select(p => (p, ((JsonPropertyNameAttribute?)p.GetCustomAttributes(typeof(JsonPropertyNameAttribute), true).SingleOrDefault())?.Name));
|
||||||
|
|
||||||
// Property has a value
|
// Property has a value
|
||||||
var property = resultProperties.SingleOrDefault(p => p.Name == prop.Name).p;
|
var property = resultProperties.SingleOrDefault(p => p.Name == prop.Name).p;
|
||||||
|
@ -9,12 +9,18 @@ namespace CryptoExchange.Net.Testing
|
|||||||
{
|
{
|
||||||
if (message.Contains("Cannot map"))
|
if (message.Contains("Cannot map"))
|
||||||
throw new Exception("Enum value error: " + message);
|
throw new Exception("Enum value error: " + message);
|
||||||
|
|
||||||
|
if (message.Contains("Received null enum value"))
|
||||||
|
throw new Exception("Enum null error: " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void WriteLine(string message)
|
public override void WriteLine(string message)
|
||||||
{
|
{
|
||||||
if (message.Contains("Cannot map"))
|
if (message.Contains("Cannot map"))
|
||||||
throw new Exception("Enum value error: " + message);
|
throw new Exception("Enum value error: " + message);
|
||||||
|
|
||||||
|
if (message.Contains("Received null enum value"))
|
||||||
|
throw new Exception("Enum null error: " + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user