BridgeTests.Tests.TestHelpMethods.TestConvertDictionaryToEntry1WithParameterTypeAreEntry1AndInJsonFormat C# (CSharp) Метод

TestConvertDictionaryToEntry1WithParameterTypeAreEntry1AndInJsonFormat() приватный Метод

        public void TestConvertDictionaryToEntry1WithParameterTypeAreEntry1AndInJsonFormat()
        {
            // This Test case checks if an object that is not an array is not recognized as Map and converted correctly
            IDictionary result = new Dictionary<String, String>();
            Entry1 keyEntry = new Entry1 { key = "Test", value = 123 };
            Entry1 valueEntry = new Entry1 { key = "ValueTest", value = 111 };
            result.Add(marshaller.MarshallObject(keyEntry), marshaller.MarshallObject(valueEntry));

            EntryWithAllEntryParameter[] arrays = (EntryWithAllEntryParameter[])result.ConvertMap(typeof(EntryWithAllEntryParameter));

            Assert.AreEqual<String>(arrays[0].key.key, keyEntry.key);
            Assert.AreEqual<int>(arrays[0].key.value, keyEntry.value);
            Assert.AreEqual<String>(arrays[0].value.key, valueEntry.key);
            Assert.AreEqual<int>(arrays[0].value.value, valueEntry.value);
        }
TestHelpMethods