mirror of
https://onedev.fprog.nl/AioNet
synced 2025-12-31 15:48:37 +01:00
More unit tests for RecursiveFieldsEqual.
This commit is contained in:
parent
953b090024
commit
f04f6c7a71
|
|
@ -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<string, string> first = new Dictionary<string, string> { { "one", "two" } };
|
||||
Dictionary<string, string> second = new Dictionary<string, string> { { "one", "two" } };
|
||||
|
||||
Assert.True(first.RecursiveFieldsEqual(second));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DictionaryKeyFalseComparison()
|
||||
{
|
||||
Dictionary<string, string> first = new Dictionary<string, string> { { "one", "two" } };
|
||||
Dictionary<string, string> second = new Dictionary<string, string> { { "six", "two" } };
|
||||
|
||||
Assert.False(first.RecursiveFieldsEqual(second));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DictionaryValueFalseComparison()
|
||||
{
|
||||
Dictionary<string, string> first = new Dictionary<string, string> { { "one", "two" } };
|
||||
Dictionary<string, string> second = new Dictionary<string, string> { { "one", "six" } };
|
||||
|
||||
Assert.False(first.RecursiveFieldsEqual(second));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HashSetComparison()
|
||||
{
|
||||
HashSet<string> first = new HashSet<string> { "banana", "apple", "orange" };
|
||||
HashSet<string> second = new HashSet<string> { "banana", "apple", "orange" };
|
||||
|
||||
Assert.True(first.RecursiveFieldsEqual(second));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue