Ejemplo n.º 1
0
        public void Xid_Equals_ReturnsTrueWhenEqual()
        {
            var x = Xid.NewXid();
            var y = new Xid(x.ToBytes());

            Assert.AreEqual <Xid>(x, y);
            Assert.AreEqual <string>(x.ToString(), y.ToString());
            Assert.IsTrue(x == y);
        }
Ejemplo n.º 2
0
        public void Xid_Parse_ParsesValueToExpectedBytes()
        {
            var x = Xid.Parse("9m4e2mr0ui3e8a215n4g");
            var y = new Xid(new byte[] { 0x4d, 0x88, 0xe1, 0x5b, 0x60, 0xf4, 0x86, 0xe4, 0x28, 0x41, 0x2d, 0xc9 });

            Assert.AreEqual(x, y);
            Assert.AreEqual("9m4e2mr0ui3e8a215n4g", y.ToString());
            Assert.AreEqual(4271561, x.GetCounter());
            Assert.AreEqual(63436413019, x.GetTimestamp().Subtract(DateTime.MinValue).TotalSeconds);
            Assert.AreEqual(0xe428, x.GetProcessId());
        }