Exemple #1
0
        public void MapAB3()
        {
#if !DEBUG
        Assert.Multiple(() => {
#endif
            var expected = new Dictionary<string, string> { { "a", "aaa" }, { "b", "aaa" }, { "c", "cake" } };
            var actual = _object.MapAB3(new Dictionary<string, string> { { "a", "aaa" }, { "c", "cake" } });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "a", "bbb" }, { "b", "bbb" }, { "c", "cake" } };
            actual = _object.MapAB3(new Dictionary<string, string> { { "b", "bbb" }, { "c", "cake" } });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "a", "aaa" }, { "b", "bbb" }, { "c", "cake" } };
            actual = _object.MapAB3(new Dictionary<string, string> { { "a", "aaa" }, { "b", "bbb" }, { "c", "cake" } });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "ccc", "ccc" } };
            actual = _object.MapAB3(new Dictionary<string, string> { { "ccc", "ccc" } });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string> { { "c", "a" }, { "d", "b" } };
            actual = _object.MapAB3(new Dictionary<string, string> { { "c", "a" }, { "d", "b" } });
            CollectionAssert.AreEquivalent(expected, actual);

            expected = new Dictionary<string, string>();
            actual = _object.MapAB3(new Dictionary<string, string>());
            CollectionAssert.AreEquivalent(expected, actual);

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

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

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

            expected = new Dictionary<string, string> { { "aa", "aa" }, { "a", "apple" }, { "b", "apple" }, { "z", "zzz" } };
            actual = _object.MapAB3(new Dictionary<string, string> { { "aa", "aa" }, { "a", "apple" }, { "z", "zzz" } });
            CollectionAssert.AreEquivalent(expected, actual);
#if !DEBUG
});
#endif
        }