public void WordCount() { #if !DEBUG Assert.Multiple(() => { #endif var expected = new Dictionary<string, int> { { "a", 2 }, { "b", 2 }, { "c", 1 } }; var actual = _object.WordCount(new[] { "a", "b", "a", "c", "b" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "a", 1 }, { "b", 1 }, { "c", 1 } }; actual = _object.WordCount(new[] { "c", "b", "a" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "c", 4 } }; actual = _object.WordCount(new[] { "c", "c", "c", "c" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int>(); actual = _object.WordCount(new string[0]); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "", 1 }, { "and", 1 }, { "this", 2 } }; actual = _object.WordCount(new[] { "this", "and", "this", "" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "x", 2 }, { "X", 1 }, { "y", 1 }, { "Y", 1 } }; actual = _object.WordCount(new[] { "x", "y", "x", "Y", "X" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "0", 1 }, { "1", 1 }, { "123", 2 } }; actual = _object.WordCount(new[] { "123", "0", "123", "1" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "a", 4 }, { "b", 5 }, { "d", 3 }, { "e", 1 }, { "f", 1 }, { "one", 1 }, { "x", 2 }, { "z", 2 }, { "two", 2 } }; actual = _object.WordCount(new[] { "d", "a", "e", "d", "a", "d", "b", "b", "z", "a", "a", "b", "z", "x", "b", "f", "x", "two", "b", "one", "two" }); CollectionAssert.AreEquivalent(expected, actual); expected = new Dictionary<string, int> { { "banana", 2 }, { "apple", 3 }, { "tea", 1 }, { "coffee", 1 } }; actual = _object.WordCount(new[] { "apple", "banana", "apple", "apple", "tea", "coffee", "banana" }); CollectionAssert.AreEquivalent(expected, actual); #if !DEBUG }); #endif }