Ejemplo n.º 1
0
        public void ToInt32()
        {
            Guid guid1 = new Guid("00000000-0000-0000-0000-000000000000");
            Guid guid2 = new Guid("00000400-0000-0000-0000-000000000000");
            Guid guid3 = new Guid("7fffffff-0000-0000-0000-000000000000");

            Assert.AreEqual(0, GuidUtils.ToInt32(guid1), "#1A");
            Assert.AreEqual(0, guid1.ToInt32(), "#1B");

            Assert.AreEqual(1024, GuidUtils.ToInt32(guid2), "#2A");
            Assert.AreEqual(1024, guid2.ToInt32(), "#2B");

            Assert.AreEqual(int.MaxValue, GuidUtils.ToInt32(guid3), "#3A");
            Assert.AreEqual(int.MaxValue, guid3.ToInt32(), "#3B");
        }