Esempio n. 1
0
        public void JsonSettings_CreateDefault_Has_Expected_Settings()
        {
            var settings = JsonSettings.CreateDefaults();

            Assert.Equal(settings.NullValueHandling, Newtonsoft.Json.NullValueHandling.Include);
            Assert.Equal(settings.MissingMemberHandling, Newtonsoft.Json.MissingMemberHandling.Ignore);
            Assert.Equal(settings.TypeNameHandling, Newtonsoft.Json.TypeNameHandling.None);
            Assert.Equal(settings.ReferenceLoopHandling, Newtonsoft.Json.ReferenceLoopHandling.Error);
            Assert.Equal(settings.PreserveReferencesHandling, Newtonsoft.Json.PreserveReferencesHandling.None);
            Assert.NotNull(settings.Converters);
            Assert.Equal(2, settings.Converters.Count);
            Assert.IsType <IsoDateTimeConverter>(settings.Converters[0]);
            Assert.IsType <JsonSafeInt64Converter>(settings.Converters[1]);
        }