예제 #1
0
        public void ApplyEqualsMustReturnExpectedResultForClassObjectsWithDifferentEqualsResultAndExpectedEqualFalse()
        {
            // Arrange
            var first  = new BikeWithEqualsClassObject("Giant", "Revolt", 2020);
            var second = new BikeWithEqualsClassObject("Giant", "Liv", 2020);

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

            // Assert
            result.Should().BeSuccess();
        }
예제 #2
0
        public void ApplyEqualsMustReturnExpectedResultForClassObjectsWithDifferentEqualsResultAndExpectedEqualTrue()
        {
            // Arrange
            var first  = new BikeWithEqualsClassObject("Giant", "Revolt", 2020);
            var second = new BikeWithEqualsClassObject("Giant", "Liv", 2020);

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

            // Assert
            result.Should().BeFailure("Equals returned 'false' on expected equal objects.");
        }