public void ByteKey_should_be_structurally_different_for_different_arrays(Guid x, Guid y) { ByteKey key1 = x.ToByteArray(); ByteKey key2 = y.ToByteArray(); (key1 == key2).Should().BeFalse(); (key2 == key1).Should().BeFalse(); }
public void Setup() { var binary1 = new byte[100]; var binary2 = new byte[100]; SafeRandom.Current.NextBytes(binary1); // change binary2 on the last position binary1.CopyTo(binary2, 0); binary2[binary2.Length - 1] ^= binary2[binary2.Length - 1]; key1 = binary1; key2 = binary2; }
public void ByteKey_should_be_structurally_comparable_when_arrays_have_the_same_content_but_different_references(byte[] expected) { var other = new byte[expected.Length]; expected.CopyTo(other, 0); ByteKey key1 = expected; ByteKey key2 = other; ReferenceEquals(other, expected).Should().BeFalse(); (key1 == key2).Should().BeTrue(); (key2 == key1).Should().BeTrue(); }
public static void PressButton(ByteKey key) { byte b = (byte)key; PressKey(b); }
internal Var(KeyspaceType keyspace, ByteKey key) { this.keyspace = keyspace; this.key = key; }
public static Global <B> Global <B>(ByteKey key) where B : class, IBinding => new Global <B>(key);
public static Local <B> Local <B>(ByteKey regionKey, ByteKey key) where B : class, IBinding => new Local <B>(regionKey, key);
public static Local <B> Local <B>(ByteKey regionKey, [NotNull] string key, Encoding encoding) where B : class, IBinding => new Local <B>(encoding.GetBytes(key));
public static Local <B> Local <B>(ByteKey regionKey, Guid key) where B : class, IBinding => new Local <B>(regionKey, key.ToByteArray());
public static Local <B> Local <B>(ByteKey regionKey, ulong key) where B : class, IBinding => new Local <B>(regionKey, BitConverter.GetBytes(key));