示例#1
0
        public void LongGuid_TryParse_InvalidLength_False()
        {
            // Act
            bool result = LongGuid.TryParse("0", out LongGuid parsed);

            // Assert
            Check.That(result).IsFalse();
            Check.That(parsed).Equals(LongGuid.Empty);
        }
示例#2
0
        public void LongGuid_TryParse_InvalidContent_False()
        {
            // Act
            bool result = LongGuid.TryParse("test0000-0000-0000-0000-000000000001-20000000-0000-0000-0000-000000000002-30000000-0000-0000-0000-000000000003-40000000-0000-0000-0000-000000000004", out LongGuid parsed);

            // Assert
            Check.That(result).IsFalse();
            Check.That(parsed).Equals(LongGuid.Empty);
        }
示例#3
0
        public void LongGuid_TryParse_True()
        {
            // Assign
            var guid1    = Guid.Parse("10000000-0000-0000-0000-000000000001");
            var guid2    = Guid.Parse("20000000-0000-0000-0000-000000000002");
            var guid3    = Guid.Parse("30000000-0000-0000-0000-000000000003");
            var guid4    = Guid.Parse("40000000-0000-0000-0000-000000000004");
            var longGuid = new LongGuid(guid1, guid2, guid3, guid4);

            // Act
            bool result = LongGuid.TryParse("10000000-0000-0000-0000-000000000001-20000000-0000-0000-0000-000000000002-30000000-0000-0000-0000-000000000003-40000000-0000-0000-0000-000000000004", out LongGuid parsed);

            // Assert
            Check.That(result).IsTrue();
            Check.That(parsed).Equals(longGuid);
        }