public void XorTest() { NodeId zero = new NodeId(new byte[20]); byte[] b = new byte[20]; b[0] = 1; NodeId one = new NodeId(b); NodeId r = one.Xor(zero); Assert.AreEqual(one, r, "#1"); Assert.IsTrue(one > zero, "#2"); Assert.IsTrue(one.CompareTo(zero) > 0, "#3"); NodeId z = one.Xor(r); Assert.AreEqual(zero, z, "#4"); }
public void XorTest() { var zero = new NodeId(new byte[20]); var b = new byte[20]; b[0] = 1; var one = new NodeId(b); var r = one.Xor(zero); Assert.Equal(one, r); Assert.True(one > zero); Assert.True(one.CompareTo(zero) > 0); var z = one.Xor(r); Assert.Equal(zero, z); }
public void XorTest() { NodeId zero = new NodeId(new byte[20]); byte[] b = new byte[20]; b[0] = 1; NodeId one = new NodeId(b); NodeId r = one.Xor(zero); Assert.Equal(one, r); Assert.True(one > zero); Assert.True(one.CompareTo(zero) > 0); NodeId z = one.Xor(r); Assert.Equal(zero, z); }