public void We_Can_compare_two_string_abs()
        {
            var firstString  = "aeiou";
            var secondString = "aeiou";

            Assert.True(ClassCompared.AbsoluteCompareResult(firstString, secondString));
        }
        public void DefaultComplexType_can_be_compare_with_both_methods_wiht_same_result()
        {
            var oneComplexClass = new ClassToCompare();
            var twoComplexClass = new ClassToCompare();

            Assert.Equal(ClassCompared.AbsoluteCompareResult(oneComplexClass, twoComplexClass), ClassCompared.ComparePropertiesResult(oneComplexClass, twoComplexClass));
            Assert.True(ClassCompared.AbsoluteCompareResult(oneComplexClass, twoComplexClass));
        }
        public void If_we_compare_two_diferent_int_we_get_always_false()
        {
            int?firstInt  = 5;
            int?secondInt = 0;

            Assert.False(ClassCompared.ComparePropertiesResult(firstInt, secondInt));
            Assert.False(ClassCompared.AbsoluteCompareResult(firstInt, secondInt));
            Assert.False(ClassCompared.ComparePropertiesResult(null, secondInt));
            Assert.False(ClassCompared.AbsoluteCompareResult(null, secondInt));
        }
        public void DefaultComplexType_with_diferent_properties_initialiced_can_be_compare_with_both_methods_wiht_same_result()
        {
            var oneComplexClass = new ClassToCompare()
            {
                ontInt = 5, oneString = "test"
            };
            var twoComplexClass = new ClassToCompare()
            {
                ontInt = 5, otherString = "test"
            };

            Assert.Equal(ClassCompared.AbsoluteCompareResult(oneComplexClass, twoComplexClass), ClassCompared.ComparePropertiesResult(oneComplexClass, twoComplexClass));
            Assert.False(ClassCompared.AbsoluteCompareResult(oneComplexClass, twoComplexClass));
        }
        public void DefaultComplexType_with_diferent_properties_initialiced_can_be_compare_with_both_methods_wiht_diferent_result_if_in_compareproperties_exclude_propertie_that_are_diferent()
        {
            var oneComplexClass = new ClassToCompare()
            {
                ontInt = 5, oneString = "test"
            };
            var twoComplexClass = new ClassToCompare()
            {
                ontInt = 5, otherString = "test"
            };

            Assert.NotEqual(ClassCompared.AbsoluteCompareResult(oneComplexClass, twoComplexClass), ClassCompared.ComparePropertiesResult(oneComplexClass, twoComplexClass, new List <string>()
            {
                "oneString", "otherString"
            }));
            Assert.False(ClassCompared.AbsoluteCompareResult(oneComplexClass, twoComplexClass));
        }
        public void If_we_compare_two_diferent_list_of_string_with_AbsoluteCompare_only_get_true_if_all_items_are_equal()
        {
            var firstListString = new List <string>()
            {
                "a", "ei", "ou"
            };
            var secondListString = new List <string>()
            {
                "a", "ei", "ou"
            };
            var firstListStringA = new List <string>()
            {
                "a", "ei", "ou", string.Empty
            };
            var secondListStringA = new List <string>()
            {
                "a", "ei", "ou", null
            };

            Assert.True(ClassCompared.AbsoluteCompareResult(firstListString, secondListString));
            Assert.False(ClassCompared.AbsoluteCompareResult(firstListStringA, secondListStringA));
        }
        public void If_we_compare_empty_vs_null_in_absolutecompareresult_we_have_false()
        {
            var firstString = string.Empty;

            Assert.False(ClassCompared.AbsoluteCompareResult(firstString, null));
        }