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

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

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

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

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