using System.Collections.Generic; using Amazon.Extensions.Configuration.SystemsManager.Internal; using Xunit; namespace Amazon.Extensions.Configuration.SystemsManager.Tests { public class DictionaryExtensionsTests { [Theory] [MemberData(nameof(EquivalentToData))] public void TestEquivalentTo(IDictionary first, IDictionary second, bool equals) { Assert.Equal(equals, first.EquivalentTo(second)); } public static TheoryData, IDictionary, bool> EquivalentToData => new TheoryData, IDictionary, bool> { {new Dictionary(), new Dictionary(), true}, {new Dictionary(), null, false}, {new Dictionary(), new Dictionary {{"a", "a"}}, false}, {new Dictionary {{"a", "a"}}, new Dictionary {{"a", "a"}}, true}, {new Dictionary {{"a", "a"}}, new Dictionary {{"a", "a"}, {"b", "b"}}, false}, {new Dictionary {{"a", "a"}}, new Dictionary {{"b", "b"}}, false}, {new Dictionary {{"a", "a"}}, new Dictionary {{"a", "b"}}, false}, {new Dictionary {{"a", "a"}}, new Dictionary {{"b", "a"}}, false}, {new Dictionary {{"a", "a"},{"b", "b"}}, new Dictionary {{"b", "b"},{"a", "a"}}, true} }; } }