Example #1
0
        public void ByteArray()
        {
            KeyBytes empty = default;

            AssertBytesEqual(ImmutableArray <byte> .Empty, empty.ByteArray);
            AssertBytesEqual(Array.Empty <byte>(), empty.ToByteArray());

            var foo = new KeyBytes(0x66, 0x6f, 0x6f);

            AssertBytesEqual(ImmutableArray.Create <byte>(0x66, 0x6f, 0x6f), foo.ByteArray);
            AssertBytesEqual(new byte[] { 0x66, 0x6f, 0x6f }, foo.ToByteArray());
        }
Example #2
0
 public static void AssertBytesEqual(KeyBytes?expected, KeyBytes?actual) =>
 AssertBytesEqual(expected?.ToByteArray(), actual?.ToByteArray());
Example #3
0
 public static void AssertBytesEqual(KeyBytes expected, KeyBytes actual) =>
 AssertBytesEqual(expected.ToByteArray(), actual.ToByteArray());