< Summary

Class:Microsoft.Azure.ApplicationInsights.Query.Models.BaseSegmentInfo
Assembly:Microsoft.Azure.ApplicationInsights.Query
File(s):C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\Models\BaseSegmentInfo.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:35
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_SegmentId()-0%100%
get_SegmentValue()-0%100%
InitSegmentFields(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\Models\BaseSegmentInfo.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Runtime.Serialization;
 5using System.Text;
 6using System.Threading.Tasks;
 7using Microsoft.Azure.ApplicationInsights.Query.Models;
 8using Newtonsoft.Json.Linq;
 9
 10namespace Microsoft.Azure.ApplicationInsights.Query.Models
 11{
 12    public abstract class BaseSegmentInfo : BaseMetricInfo
 13    {
 014        public string SegmentId { get; private set; }
 015        public string SegmentValue { get; private set; }
 16
 17        [OnDeserialized]
 18        internal void InitSegmentFields(StreamingContext context)
 19        {
 020            var additionalProperties = GetAdditionalProperties();
 21
 022            if (additionalProperties != null)
 23            {
 024                foreach (var additionalProp in additionalProperties)
 25                {
 026                    if (additionalProp.Value is string)
 27                    {
 028                        SegmentId = additionalProp.Key;
 029                        SegmentValue = additionalProp.Value as string;
 30                    }
 31                }
 32            }
 033        }
 34    }
 35}