< Summary

Class:Azure.Core.GeoJson.GeoPolygonCollection
Assembly:Azure.Core.Experimental
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.Experimental\src\Spatial\GeoPolygonCollection.cs
Covered lines:5
Uncovered lines:6
Coverable lines:11
Total lines:55
Line coverage:45.4% (5 of 11)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_Polygons()-100%100%
GetEnumerator()-0%100%
System.Collections.IEnumerable.GetEnumerator()-0%100%
get_Count()-0%100%
get_Item(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.Experimental\src\Spatial\GeoPolygonCollection.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections;
 5using System.Collections.Generic;
 6using System.Linq;
 7
 8namespace Azure.Core.GeoJson
 9{
 10    /// <summary>
 11    /// Represents a geometry that is composed of multiple <see cref="GeoPolygon"/>.
 12    /// </summary>
 13    public sealed class GeoPolygonCollection : GeoObject, IReadOnlyList<GeoPolygon>
 14    {
 15        /// <summary>
 16        /// Initializes new instance of <see cref="GeoPolygonCollection"/>.
 17        /// </summary>
 18        /// <param name="polygons">The collection of inner polygons.</param>
 019        public GeoPolygonCollection(IEnumerable<GeoPolygon> polygons): this(polygons, null, DefaultProperties)
 20        {
 021        }
 22
 23        /// <summary>
 24        /// Initializes new instance of <see cref="GeoPolygonCollection"/>.
 25        /// </summary>
 26        /// <param name="polygons">The collection of inner geometries.</param>
 27        /// <param name="boundingBox">The <see cref="GeoBoundingBox"/> to use.</param>
 28        /// <param name="additionalProperties">The set of additional properties associated with the <see cref="GeoObject
 1629        public GeoPolygonCollection(IEnumerable<GeoPolygon> polygons, GeoBoundingBox? boundingBox, IReadOnlyDictionary<s
 30        {
 1631            Argument.AssertNotNull(polygons, nameof(polygons));
 32
 1633            Polygons = polygons.ToArray();
 1634        }
 35
 2036        internal IReadOnlyList<GeoPolygon> Polygons { get; }
 37
 38        /// <inheritdoc />
 39        public IEnumerator<GeoPolygon> GetEnumerator()
 40        {
 041            return Polygons.GetEnumerator();
 42        }
 43
 44        IEnumerator IEnumerable.GetEnumerator()
 45        {
 046            return GetEnumerator();
 47        }
 48
 49        /// <inheritdoc />
 050        public int Count => Polygons.Count;
 51
 52        /// <inheritdoc />
 053        public GeoPolygon this[int index] => Polygons[index];
 54    }
 55}