Beispiel #1
0
        public void DictionaryToJson_NoNested_Sucess()
        {
            var dictionary = new Dictionary <string, string>
            {
                { "code", "123" },
                { "color", "red" },
                { "size", "XL" },
                { "price", "100" },
                { "currency", "JPY" }
            };

            var ordersWriter = new OrdersWriter(new Orders());
            var json         = ordersWriter.DictionaryToJson(dictionary);

            Assert.AreEqual("{\"code\": \"123\",\"color\": \"red\",\"size\": \"XL\",\"price\": \"100\",\"currency\": \"JPY\"}", json);
        }