< Summary

Class:Azure.Core.GeoJson.GeoBoundingBox
Assembly:Azure.Core.Experimental
File(s):C:\Git\azure-sdk-for-net\sdk\core\Azure.Core.Experimental\src\Spatial\GeoBoundingBox.cs
Covered lines:16
Uncovered lines:8
Coverable lines:24
Total lines:86
Line coverage:66.6% (16 of 24)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_West()-100%100%
get_South()-100%100%
get_East()-100%100%
get_North()-100%100%
get_MinAltitude()-100%100%
get_MaxAltitude()-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
Equals(...)-0%0%
Equals(...)-0%0%
GetHashCode()-0%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5
 6namespace Azure.Core.GeoJson
 7{
 8    /// <summary>
 9    /// Represents information about the coordinate range of the <see cref="GeoObject"/>.
 10    /// </summary>
 11    public sealed class GeoBoundingBox : IEquatable<GeoBoundingBox>
 12    {
 13        /// <summary>
 14        /// The westmost value of <see cref="GeoObject"/> coordinates.
 15        /// </summary>
 1616        public double West { get; }
 17
 18        /// <summary>
 19        /// The southmost value of <see cref="GeoObject"/> coordinates.
 20        /// </summary>
 1621        public double South { get; }
 22
 23        /// <summary>
 24        /// The eastmost value of <see cref="GeoObject"/> coordinates.
 25        /// </summary>
 1626        public double East { get; }
 27
 28        /// <summary>
 29        /// The northmost value of <see cref="GeoObject"/> coordinates.
 30        /// </summary>
 1631        public double North { get; }
 32
 33        /// <summary>
 34        /// The minimum altitude value of <see cref="GeoObject"/> coordinates.
 35        /// </summary>
 2236        public double? MinAltitude { get; }
 37
 38        /// <summary>
 39        /// The maximum altitude value of <see cref="GeoObject"/> coordinates.
 40        /// </summary>
 2241        public double? MaxAltitude { get; }
 42
 43        /// <summary>
 44        /// Initializes a new instance of <see cref="GeoBoundingBox"/>.
 45        /// </summary>
 846        public GeoBoundingBox(double west, double south, double east, double north) : this(west, south, east, north, nul
 47        {
 848        }
 49
 50        /// <summary>
 51        /// Initializes a new instance of <see cref="GeoBoundingBox"/>.
 52        /// </summary>
 1653        public GeoBoundingBox(double west, double south, double east, double north, double? minAltitude, double? maxAlti
 54        {
 1655            West = west;
 1656            South = south;
 1657            East = east;
 1658            North = north;
 1659            MinAltitude = minAltitude;
 1660            MaxAltitude = maxAltitude;
 1661        }
 62
 63        /// <inheritdoc />
 64        public bool Equals(GeoBoundingBox other)
 65        {
 066            return West.Equals(other.West) &&
 067                   South.Equals(other.South) &&
 068                   East.Equals(other.East) &&
 069                   North.Equals(other.North) &&
 070                   Nullable.Equals(MinAltitude, other.MinAltitude) &&
 071                   Nullable.Equals(MaxAltitude, other.MaxAltitude);
 72        }
 73
 74        /// <inheritdoc />
 75        public override bool Equals(object? obj)
 76        {
 077            return obj is GeoBoundingBox other && Equals(other);
 78        }
 79
 80        /// <inheritdoc />
 81        public override int GetHashCode()
 82        {
 083            return HashCodeBuilder.Combine(West, South, East, North, MinAltitude, MaxAltitude);
 84        }
 85    }
 86}