public static void AssertDataField(this XElement element, string expectedValue) { element.AssertName("data"); element.AssertValue(expectedValue); element.AssertNumFields(2); var dataData = element.Fields().First(); dataData.AssertName("data.data"); dataData.AssertValue(expectedValue); var dataLen = element.Fields().Last(); dataLen.AssertName("data.len"); dataLen.AssertShowDecimal(expectedValue.Length / 2); }
public static void AssertValue(this XElement element, IEnumerable<IpV4Address> expectedValue) { element.AssertValue(expectedValue.Select(ip => ip.ToValue())); }
public static void AssertValue(this XElement element, IEnumerable<uint> expectedValue) { element.AssertValue(expectedValue.Select(value => value.ToString("x8"))); }
public static void AssertValue(this XElement element, IEnumerable<string> expectedValue) { element.AssertValue(expectedValue.SequenceToString()); }
public static void AssertValue(this XElement element, SerialNumber32 expectedValue) { element.AssertValue(expectedValue.Value); }
public static void AssertValue(this XElement element, UInt128 expectedValue) { element.AssertValue(expectedValue.ToString("x32")); }
public static void AssertValue(this XElement element, ulong expectedValue) { element.AssertValue(expectedValue.ToString("x16")); }
public static void AssertValue(this XElement element, ushort expectedValue, string message = null) { element.AssertValue(expectedValue.ToString("x4"), message); }
public static void AssertValue(this XElement element, byte expectedValue) { element.AssertValue(expectedValue.ToString("x2")); }
public static void AssertValue(this XElement element, IEnumerable<byte> expectedValue, string message = null) { element.AssertValue(expectedValue.BytesSequenceToHexadecimalString(), message); }