コード例 #1
0
        public static void LowerCaseJsonSerializerSettings_Should_Return_Parsed_Object()
        {
            // arrange
            var obj = new JsonExampleTest
            {
                SomeTest = "test"
            };

            // act
            var json = JsonConvert.SerializeObject(obj, JsonUtility.LowerCaseJsonSerializerSettings);

            // assert
            Assert.Contains("sometest", json);
        }
コード例 #2
0
        public static void LowerCaseJsonSerializer_Should_Return_Parsed_Object()
        {
            // arrange
            var obj = new JsonExampleTest
            {
                SomeTest = "test"
            };
            StringBuilder sb         = new StringBuilder();
            StringWriter  sw         = new StringWriter(sb);
            JsonWriter    jsonWriter = new JsonTextWriter(sw);

            // act
            JsonUtility.LowerCaseJsonSerializer.Serialize(jsonWriter, obj);

            // assert
            Assert.Contains("sometest", sb.ToString());
        }