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()); }
public static void AssertBytesEqual(KeyBytes?expected, KeyBytes?actual) => AssertBytesEqual(expected?.ToByteArray(), actual?.ToByteArray());
public static void AssertBytesEqual(KeyBytes expected, KeyBytes actual) => AssertBytesEqual(expected.ToByteArray(), actual.ToByteArray());