示例#1
0
        public void ParseShouldReturnOptionGuidNone()
        {
            // Arrange
            var           input    = "not a Guid";
            Option <Guid> expected = None;

            // Act
            var result = GuidType.Parse(input);

            // Assert
            result.Should().Be(expected);
        }
示例#2
0
        public void ParseShouldReturnOptionGuidSomeWhenInputFormat4HexadecimalsEnclosedInBracesWithTheFourthSubsetOf8HexadecimalsEnclosedInBraces()
        {
            // Arrange
            var           originalGuid = Guid.NewGuid();
            var           input        = originalGuid.ToString("X");
            Option <Guid> expected     = Some(originalGuid);

            // Act
            var result = GuidType.Parse(input);

            // Assert
            result.Should().Be(expected);
        }
示例#3
0
        public void ParseShouldReturnOptionGuidSomeWhenInputFormat32DigitsSeparatedByHyphensEnclosedInParentheses()
        {
            // Arrange
            var           originalGuid = Guid.NewGuid();
            var           input        = originalGuid.ToString("P");
            Option <Guid> expected     = Some(originalGuid);

            // Act
            var result = GuidType.Parse(input);

            // Assert
            result.Should().Be(expected);
        }