コード例 #1
0
        public void DetectsDifferentKeys()
        {
            var x = new Dictionary <string, AttributeValue>
            {
                { "key1", new AttributeValue("value1") },
                { "key2", new AttributeValue("value2") }
            };

            var y = new Dictionary <string, AttributeValue>
            {
                { "key1", new AttributeValue("value1") },
                { "key3", new AttributeValue("value3") }
            };

            var comparer = new DbKeyEqualityComparer();

            comparer.Equals(x, y).ShouldBeFalse();
        }
コード例 #2
0
        public void DetectsDuplicatesWithKeysInDifferentOrder()
        {
            var x = new Dictionary <string, AttributeValue>
            {
                { "key1", new AttributeValue("value1") },
                { "key2", new AttributeValue("value2") }
            };

            var y = new Dictionary <string, AttributeValue>
            {
                { "key2", new AttributeValue("value2") },
                { "key1", new AttributeValue("value1") }
            };

            var comparer = new DbKeyEqualityComparer();

            comparer.Equals(x, y).ShouldBeTrue();
        }