Exemplo n.º 1
0
        public void AddDuplicateKeysFromStringKeyedDictionaryThrowsException()
        {
            var messageData = new MessageData();
            var source1     = new Dictionary <string, object>
            {
                { "key1", "value" },
                { "key2", "value" }
            };

            messageData.AddFromDictionary(source1);
            var source2 = new Dictionary <string, object>
            {
                { "key1", "value" }
            };

            Assert.Throws <ArgumentException>(() => messageData.AddFromDictionary(source2));
        }
Exemplo n.º 2
0
        public void AddFromObjectKeyedDictionaryAddsPairs()
        {
            var messageData = new MessageData();
            var source      = new Dictionary <object, object>
            {
                { "key1", "value" },
                { "key2", "value" }
            };

            messageData.AddFromDictionary(source);

            Assert.That(messageData, Is.EquivalentTo(source));
        }
Exemplo n.º 3
0
        public void AddFromNullStringKeyedDictionaryThrowsException()
        {
            var messageData = new MessageData();

            Assert.Throws <ArgumentNullException>(() => messageData.AddFromDictionary((IDictionary <string, object>)null));
        }