コード例 #1
0
        public void Pairs()
        {
#if !DEBUG
        Assert.Multiple(() => {
#endif
            var expected = new Dictionary<string, string> { { "b", "g" }, { "c", "e" } };
            var actual = _object.Pairs(new[] { "code", "bug" });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "m", "n" } };
            actual = _object.Pairs(new[] { "man", "moon", "main" });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "g", "d" }, { "m", "n" }, { "n", "t" } };
            actual = _object.Pairs(new[] { "man", "moon", "good", "night" });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string>();
            actual = _object.Pairs(new string[0]);
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "a", "a" }, { "b", "b" } };
            actual = _object.Pairs(new[] { "a", "b" });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "a", "d" }, { "c", "s" } };
            actual = _object.Pairs(new[] { "are", "codes", "and", "cods" });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "a", "e" }, { "b", "a" }, { "c", "e" }, { "t", "a" } };
            actual = _object.Pairs(new[] { "apple", "banana", "tea", "coffee" });
            CollectionAssert.AreEquivalent(expected, actual);
#if !DEBUG
});
#endif
        }