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);
        }
示例#2
0
 public static void AssertValue(this XElement element, IEnumerable<IpV4Address> expectedValue)
 {
     element.AssertValue(expectedValue.Select(ip => ip.ToValue()));
 }
示例#3
0
 public static void AssertValue(this XElement element, IEnumerable<uint> expectedValue)
 {
     element.AssertValue(expectedValue.Select(value => value.ToString("x8")));
 }
示例#4
0
 public static void AssertValue(this XElement element, IEnumerable<string> expectedValue)
 {
     element.AssertValue(expectedValue.SequenceToString());
 }
示例#5
0
 public static void AssertValue(this XElement element, SerialNumber32 expectedValue)
 {
     element.AssertValue(expectedValue.Value);
 }
示例#6
0
 public static void AssertValue(this XElement element, UInt128 expectedValue)
 {
     element.AssertValue(expectedValue.ToString("x32"));
 }
示例#7
0
 public static void AssertValue(this XElement element, ulong expectedValue)
 {
     element.AssertValue(expectedValue.ToString("x16"));
 }
示例#8
0
 public static void AssertValue(this XElement element, ushort expectedValue, string message = null)
 {
     element.AssertValue(expectedValue.ToString("x4"), message);
 }
示例#9
0
 public static void AssertValue(this XElement element, byte expectedValue)
 {
     element.AssertValue(expectedValue.ToString("x2"));
 }
示例#10
0
 public static void AssertValue(this XElement element, IEnumerable<byte> expectedValue, string message = null)
 {
     element.AssertValue(expectedValue.BytesSequenceToHexadecimalString(), message);
 }