Ejemplo n.º 1
0
        public void ToInt64Array()
        {
            Guid[] input = new Guid[] {
                new Guid("00000000-0000-0000-0000-000000000000"),
                new Guid("00000400-0000-0000-0000-000000000000"),
                new Guid("7fffffff-0000-0000-0000-000000000000"),
                new Guid("ffffffff-ffff-7fff-0000-000000000000")
            };

            long[] result1 = GuidUtils.ToInt64Array(input);
            long[] result2 = input.ToInt64Array();

            Assert.AreEqual(4, result1.Length);
            Assert.AreEqual(4, result2.Length);

            Assert.AreEqual(0, result1[0], "#1A");
            Assert.AreEqual(0, result2[0], "#1B");

            Assert.AreEqual(1024, result1[1], "#2A");
            Assert.AreEqual(1024, result2[1], "#2B");

            Assert.AreEqual(int.MaxValue, result1[2], "#3A");
            Assert.AreEqual(int.MaxValue, result2[2], "#3B");

            Assert.AreEqual(long.MaxValue, result1[3], "#4A");
            Assert.AreEqual(long.MaxValue, result2[3], "#4B");
        }