diff --git a/AioNet.ReflectionTest/DeepComparisonTest.cs b/AioNet.ReflectionTest/DeepComparisonTest.cs index 9f43fd8..b02f71d 100644 --- a/AioNet.ReflectionTest/DeepComparisonTest.cs +++ b/AioNet.ReflectionTest/DeepComparisonTest.cs @@ -86,4 +86,48 @@ public class DeepComparisonTest int[] y = new[] { 1, 2, 3 }; Assert.True(x.RecursiveFieldsEqual(y)); } + + [Fact] + public void ArrayFalseComparison() + { + int[] x = new[] { 1, 2, 3 }; + int[] y = new[] { 1, 1, 3 }; + Assert.False(x.RecursiveFieldsEqual(y)); + } + + [Fact] + public void DictionaryComparison() + { + Dictionary first = new Dictionary { { "one", "two" } }; + Dictionary second = new Dictionary { { "one", "two" } }; + + Assert.True(first.RecursiveFieldsEqual(second)); + } + + [Fact] + public void DictionaryKeyFalseComparison() + { + Dictionary first = new Dictionary { { "one", "two" } }; + Dictionary second = new Dictionary { { "six", "two" } }; + + Assert.False(first.RecursiveFieldsEqual(second)); + } + + [Fact] + public void DictionaryValueFalseComparison() + { + Dictionary first = new Dictionary { { "one", "two" } }; + Dictionary second = new Dictionary { { "one", "six" } }; + + Assert.False(first.RecursiveFieldsEqual(second)); + } + + [Fact] + public void HashSetComparison() + { + HashSet first = new HashSet { "banana", "apple", "orange" }; + HashSet second = new HashSet { "banana", "apple", "orange" }; + + Assert.True(first.RecursiveFieldsEqual(second)); + } }