コード例 #1
0
        public void ApplyOperatorEqualityMustReturnExpectedResultForClassObjectsWithDifferentEqualsResultAndExpectedEqualFalse()
        {
            // Arrange
            var first  = new BikeOperatorEqualityClassObject("Giant", "Revolt", 2020);
            var second = new BikeOperatorEqualityClassObject("Giant", "Liv", 2020);

            // Act
            var result = EqComponent.ApplyOperatorEquality <BikeOperatorEqualityClassObject>(first, second, false);

            // Assert
            result.Should().BeSuccess();
        }
コード例 #2
0
        public void ApplyOperatorInequalityMustReturnExpectedResultForClassObjectsThatAreActuallyUnequalTrueAndExpectedUnequalFalse()
        {
            // Arrange
            var first  = new BikeOperatorEqualityClassObject("Giant", "Revolt", 2020);
            var second = new BikeOperatorEqualityClassObject("Giant", "Liv", 2020);

            // Act
            var result = EqComponent.ApplyOperatorInequality <BikeOperatorEqualityClassObject>(first, second, false);

            // Assert
            result.Should().BeFailure("Inequality operator returned 'true' on expected equal objects.");
        }
コード例 #3
0
        public void ApplyOperatorEqualityMustReturnExpectedResultForClassObjectsWithDifferentEqualsResultAndExpectedEqualTrue()
        {
            // Arrange
            var first  = new BikeOperatorEqualityClassObject("Giant", "Revolt", 2020);
            var second = new BikeOperatorEqualityClassObject("Giant", "Liv", 2020);

            // Act
            var result = EqComponent.ApplyOperatorEquality <BikeOperatorEqualityClassObject>(first, second, true);

            // Assert
            result.Should().BeFailure("Equality operator returned 'false' on expected equal objects.");
        }
コード例 #4
0
        public void ApplyOperatorInequalityMustReturnExpectedResultForClassObjectsThatAreActuallyUnequalTrueAndExpectedUnequalTrue()
        {
            // Arrange
            var first  = new BikeOperatorEqualityClassObject("Giant", "Revolt", 2020);
            var second = new BikeOperatorEqualityClassObject("Giant", "Liv", 2020);

            // Act
            var result = EqComponent.ApplyOperatorInequality <BikeOperatorEqualityClassObject>(first, second, true);

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