コード例 #1
0
        public void testToStringEqualsUuid()
        {
            Identifier identifier1 = Identifier.Parse("2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6");

            AssertEx.AreEqual("uuidString of Identifier should match", "2f234454-cf6d-4a0f-adf2-f4911ba9ffa6", identifier1.ToUuid().ToString());
        }
コード例 #2
0
        public void testParseNonZeroPrefixedDecimalNumberAsDecimal()
        {
            Identifier id = Identifier.Parse("10");

            AssertEx.AreEqual("Should be treated as decimal", "10", id.ToString());
        }
コード例 #3
0
        public void testParseZeroPrefixedDecimalNumberAsHex()
        {
            Identifier id = Identifier.Parse("0010");

            AssertEx.AreEqual("Should be treated as hex in parse, but converted back to decimal because it is small", "16", id.ToString());
        }
コード例 #4
0
        public void testParseBigHexWithNoPrefix()
        {
            Identifier id = Identifier.Parse("123456789abcdef");

            AssertEx.AreEqual("Should parse and get prefixed hex value for big numbers", "0x0123456789abcdef", id.ToString());
        }
コード例 #5
0
        public void testToStringNormalizesCase()
        {
            Identifier identifier1 = Identifier.Parse("2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6");

            AssertEx.AreEqual("Identifiers of different case should match", "2f234454-cf6d-4a0f-adf2-f4911ba9ffa6", identifier1.ToString());
        }
コード例 #6
0
        public void testParseHexWithNoPrefix()
        {
            Identifier id = Identifier.Parse("abcd");

            AssertEx.AreEqual("Should parse and get back equivalent decimal value for small numbers", "43981", id.ToString());
        }