コード例 #1
0
        public void EquableNullMustPassWhenRight()
        {
            // Arrange
            var either = new Either <string, int>(1);

            // Act
            var result = new Equable().Null(either);

            // Assert
            result.Should().Pass();
        }
コード例 #2
0
        public void NullMustSucceed()
        {
            // Arrange
            var obj = new BikeClassObject("Giant", "Revolt", 2020);

            // Act
            var result = new Equable().Null(obj);

            // Assert
            result.Should().Pass();
        }
コード例 #3
0
        public void EquableNullMustPass()
        {
            // Arrange
            Option <int> option = Some(1);

            // Act
            var result = new Equable().Null(option);

            // Assert
            result.Should().Pass();
        }
コード例 #4
0
        public void EquableNullMustPass()
        {
            // Arrange
            Unit unit = new Unit();

            // Act
            var result = new Equable().Null(unit);

            // Assert
            result.Should().Pass();
        }
コード例 #5
0
        public void EqualMustSucceed()
        {
            // Arrange
            var first  = new BikeClassObject("Giant", "Revolt", 2020);
            var second = new BikeClassObject("Giant", "Revolt", 2020);

            // Act
            var result = new Equable().Equal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #6
0
        public void EquableUnequalMustPassWhenFirstRightAndSecondLeft()
        {
            // Arrange
            var first  = new Either <string, int>(1);
            var second = new Either <string, int>("left");

            // Act
            var result = new Equable().Unequal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #7
0
        public void EquableEqualMustPassWhenBothRight()
        {
            // Arrange
            var first  = new Either <string, int>(1);
            var second = new Either <string, int>(1);

            // Act
            var result = new Equable().Equal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #8
0
        public void EquableNullMustPassWhenException()
        {
            // Arrange
            var exception = new SomeException();
            Exceptional <string> exceptional = exception;

            // Act
            var result = new Equable().Null(exceptional);

            // Assert
            result.Should().Pass();
        }
コード例 #9
0
        public void EquableNullMustPassWhenSuccess()
        {
            // Arrange
            var value = "any value of any type besides Exception";
            Exceptional <string> exceptional = value;

            // Act
            var result = new Equable().Null(exceptional);

            // Assert
            result.Should().Pass();
        }
コード例 #10
0
        public void EquableUnequalMustPassWhenSomeAndNone()
        {
            // Arrange
            Option <int> first  = Some(1);
            Option <int> second = None;

            // Act
            var result = new Equable().Unequal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #11
0
        public void EquableEqualMustPassWhenNone()
        {
            // Arrange
            Option <int> first  = None;
            Option <int> second = None;

            // Act
            var result = new Equable().Equal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #12
0
        public void EquableEqualMustPass()
        {
            // Arrange
            Unit first  = new Unit();
            Unit second = new Unit();

            // Act
            var result = new Equable().Equal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #13
0
        public void EquableUnequalMustPassWhenFirstExceptionAndSecondSuccess()
        {
            // Arrange
            var firstException         = new SomeException();
            Exceptional <string> first = firstException;

            var value = "any value of any type besides Exception";
            Exceptional <string> second = value;

            // Act
            var result = new Equable().Unequal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #14
0
        public void EquableEqualMustPassWhenBothException()
        {
            // Arrange
            var firstException         = new SomeException();
            Exceptional <string> first = firstException;

            var secondException         = new SomeException();
            Exceptional <string> second = secondException;

            // Act
            var result = new Equable().Equal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #15
0
        public void EquableEqualMustPassWhenBothSuccess()
        {
            // Arrange
            var firstValue             = "any value of any type besides Exception";
            Exceptional <string> first = firstValue;

            var secondValue             = "any value of any type besides Exception";
            Exceptional <string> second = secondValue;

            // Act
            var result = new Equable().Equal(first, second);

            // Assert
            result.Should().Pass();
        }
コード例 #16
0
        public void EquableUnequalMustNotPass()
        {
            // Arrange
            Unit first  = new Unit();
            Unit second = new Unit();

            // Act
            var result = new Equable().Unequal(first, second);

            // Assert
            result.Should().NotPass("Equals returned 'true' on expected non-equal objects.",
                                    "Typed Equals returned 'true' on expected non-equal objects.",
                                    "Equality operator returned 'true' on expected non-equal objects.",
                                    "Inequality operator returned 'false' on expected non-equal objects.");
        }