< Summary

Class:Microsoft.Azure.EventGrid.JsonSerializerExtensions
Assembly:Microsoft.Azure.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Microsoft.Azure.EventGrid\src\Customization\JsonSerializerExtensions.cs
Covered lines:30
Uncovered lines:0
Coverable lines:30
Total lines:49
Line coverage:100% (30 of 30)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
GetJsonSerializerSettings(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Microsoft.Azure.EventGrid\src\Customization\JsonSerializerExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5using Newtonsoft.Json;
 6
 7namespace Microsoft.Azure.EventGrid
 8{
 9    static class JsonSerializerExtensions
 10    {
 11        public static JsonSerializerSettings GetJsonSerializerSettings(this JsonSerializer serializer)
 12        {
 8413            var jsonSerializerSettings = new JsonSerializerSettings
 8414            {
 8415                Context = serializer.Context,
 8416                Culture = serializer.Culture,
 8417                ContractResolver = serializer.ContractResolver,
 8418                ConstructorHandling = serializer.ConstructorHandling,
 8419                CheckAdditionalContent = serializer.CheckAdditionalContent,
 8420                DateFormatHandling = serializer.DateFormatHandling,
 8421                DateFormatString = serializer.DateFormatString,
 8422                DateParseHandling = serializer.DateParseHandling,
 8423                DateTimeZoneHandling = serializer.DateTimeZoneHandling,
 8424                DefaultValueHandling = serializer.DefaultValueHandling,
 8425                FloatFormatHandling = serializer.FloatFormatHandling,
 8426                Formatting = serializer.Formatting,
 8427                FloatParseHandling = serializer.FloatParseHandling,
 8428                MaxDepth = serializer.MaxDepth,
 8429                MetadataPropertyHandling = serializer.MetadataPropertyHandling,
 8430                MissingMemberHandling = serializer.MissingMemberHandling,
 8431                NullValueHandling = serializer.NullValueHandling,
 8432                ObjectCreationHandling = serializer.ObjectCreationHandling,
 8433                PreserveReferencesHandling = serializer.PreserveReferencesHandling,
 8434                ReferenceResolver = serializer.ReferenceResolver,
 8435                ReferenceLoopHandling = serializer.ReferenceLoopHandling,
 8436                StringEscapeHandling = serializer.StringEscapeHandling,
 8437                TraceWriter = serializer.TraceWriter,
 8438                TypeNameHandling = serializer.TypeNameHandling,
 8439            };
 40
 50241            foreach (JsonConverter converter in serializer.Converters)
 42            {
 16743                jsonSerializerSettings.Converters.Add(converter);
 44            }
 45
 8446            return jsonSerializerSettings;
 47        }
 48    }
 49}

Methods/Properties

GetJsonSerializerSettings(...)