Example #1
0
        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);
        }
Example #3
0
        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");
        }
Example #4
0
        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);
        }