Beispiel #1
0
        public void ToStringShouldProvideExpectedRepresentation()
        {
            // Arrange
            var expectedResult = "None";
            var optionNone     = new OptionNone();

            // Act
            var result = optionNone.ToString();

            // Assert
            result.Should().Be(expectedResult);
        }
Beispiel #2
0
        public void ImplicitOperatorOverloadingShouldSucceedWithOptionNone()
        {
            // Arrange
            var optionNone = new OptionNone();

            // Act
            Option <string> option = optionNone;
            var             result = option.ToString();

            // Assert
            result.Should().Be("None");
        }
Beispiel #3
0
        public void EqualsOptionNoneShouldSucceed()
        {
            // Arrange
            var first  = new OptionNone();
            var second = new OptionNone();

            // Act
            var result = first.Equals(second);

            // Assert
            result.Should().BeTrue();
        }
Beispiel #4
0
        public void EqualsOptionNoneShouldReturnFalse()
        {
            // Arrange
            OptionNone   optionNone = OptionNone.Default;
            Option <int> option     = Some(1);

            // Act
            var result = option.Equals(optionNone);

            // Assert
            result.Should().BeFalse();
        }
Beispiel #5
0
        public void CtorShouldEqualWithDefault()
        {
            // Arrange
            var first  = new OptionNone();
            var second = default(OptionNone);


            // Act
            var result = Equals(first, second);

            // Assert
            result.Should().BeTrue();
        }