refactor: Changing ordered dictionary tests to avoid false positives

This commit is contained in:
Chris Cameron
2018-05-10 17:01:16 -04:00
parent da8947aaa0
commit d9cf0bd3cf

View File

@@ -15,8 +15,8 @@ namespace ICD.Common.Utils.Tests.Collections
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int> IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
{ {
{0, 0}, {0, 0},
{1, 1}, {1, 10},
{2, 2} {2, 20}
}; };
Assert.AreEqual(3, dict.Count); Assert.AreEqual(3, dict.Count);
@@ -36,8 +36,8 @@ namespace ICD.Common.Utils.Tests.Collections
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int> IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
{ {
{0, 0}, {0, 0},
{1, 1}, {1, 10},
{-1, -1} {-1, -10}
}; };
int[] keys = dict.Keys.ToArray(); int[] keys = dict.Keys.ToArray();
@@ -54,16 +54,16 @@ namespace ICD.Common.Utils.Tests.Collections
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int> IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
{ {
{0, 0}, {0, 0},
{1, 1}, {1, 10},
{-1, -1} {-1, -10}
}; };
int[] keys = dict.Values.ToArray(); int[] values = dict.Values.ToArray();
Assert.AreEqual(3, keys.Length); Assert.AreEqual(3, values.Length);
Assert.AreEqual(-1, keys[0]); Assert.AreEqual(-10, values[0]);
Assert.AreEqual(0, keys[1]); Assert.AreEqual(0, values[1]);
Assert.AreEqual(1, keys[2]); Assert.AreEqual(10, values[2]);
} }
[Test] [Test]
@@ -72,13 +72,13 @@ namespace ICD.Common.Utils.Tests.Collections
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int> IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
{ {
{0, 0}, {0, 0},
{1, 1}, {1, 10},
{-1, -1} {-1, -10}
}; };
Assert.AreEqual(0, dict[0]); Assert.AreEqual(0, dict[0]);
Assert.AreEqual(1, dict[1]); Assert.AreEqual(10, dict[1]);
Assert.AreEqual(-1, dict[-1]); Assert.AreEqual(-10, dict[-1]);
} }
#endregion #endregion