Example #1
0
        private static void VerifyConverter(string input)
        {
            input = CosmosElementJsonConverterTests.NewtonsoftFormat(input);
            CosmosElement cosmosElement = JsonConvert.DeserializeObject <CosmosElement>(input, new CosmosElementJsonConverter());
            string        toString      = JsonConvert.SerializeObject(cosmosElement, new CosmosElementJsonConverter());

            toString = CosmosElementJsonConverterTests.NewtonsoftFormat(toString);
            Assert.IsTrue(JToken.EqualityComparer.Equals(JToken.Parse(input), JToken.Parse(toString)), $"Expected:{input}, Actual:{toString}");
        }
Example #2
0
        public void ArrayTest()
        {
            string input = "[-2,-1,0,1,2]";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }
Example #3
0
        public void ObjectTest()
        {
            string input = "{\"GlossDiv\":10,\"title\":\"example glossary\"}";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }
Example #4
0
        public void StringTest()
        {
            string input = "\"Hello World\"";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }
Example #5
0
        public void DoubleTest()
        {
            string input = "1337.1337";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }
Example #6
0
        public void NullTest()
        {
            string input = "null";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }
Example #7
0
        public void FalseTest()
        {
            string input = "false";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }
Example #8
0
        public void TrueTest()
        {
            string input = "true";

            CosmosElementJsonConverterTests.VerifyConverter(input);
        }