< Summary

Class:Azure.Core.GeoJson.GeoCollection
Assembly:Azure.Core.Experimental
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.Experimental\src\Spatial\GeoCollection.cs
Covered lines:5
Uncovered lines:6
Coverable lines:11
Total lines:58
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_Geometries()-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\GeoCollection.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 geometries.
 12    /// </summary>
 13    public sealed class GeoCollection : GeoObject, IReadOnlyList<GeoObject>
 14    {
 15        /// <summary>
 16        /// Initializes new instance of <see cref="GeoCollection"/>.
 17        /// </summary>
 18        /// <param name="geometries">The collection of inner geometries.</param>
 019        public GeoCollection(IEnumerable<GeoObject> geometries): this(geometries, null, DefaultProperties)
 20        {
 021        }
 22
 23        /// <summary>
 24        /// Initializes new instance of <see cref="GeoCollection"/>.
 25        /// </summary>
 26        /// <param name="geometries">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 GeoCollection(IEnumerable<GeoObject> geometries, GeoBoundingBox? boundingBox, IReadOnlyDictionary<string,
 30        {
 1631            Argument.AssertNotNull(geometries, nameof(geometries));
 32
 1633            Geometries = geometries.ToArray();
 1634        }
 35
 36        /// <summary>
 37        /// Gets the list of <see cref="GeoObject"/> geometry is composed of.
 38        /// </summary>
 2439        internal IReadOnlyList<GeoObject> Geometries { get; }
 40
 41        /// <inheritdoc />
 42        public IEnumerator<GeoObject> GetEnumerator()
 43        {
 044            return Geometries.GetEnumerator();
 45        }
 46
 47        IEnumerator IEnumerable.GetEnumerator()
 48        {
 049            return GetEnumerator();
 50        }
 51
 52        /// <inheritdoc />
 053        public int Count => Geometries.Count;
 54
 55        /// <inheritdoc />
 056        public GeoObject this[int index] => Geometries[index];
 57    }
 58}