< Summary

Information
Class: MyNet.Geography.Address
Assembly: MyNet.Geography
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Geography/Address.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 32
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ToString()100%22100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Geography/Address.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="Address.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Linq;
 8
 9namespace MyNet.Geography;
 10
 11/// <summary>
 12/// Represents a physical address, including optional geographic coordinates. This record can be used to store and manip
 13/// </summary>
 14/// <param name="Street">The street address.</param>
 15/// <param name="PostalCode">The postal code.</param>
 16/// <param name="City">The city.</param>
 17/// <param name="Country">The country.</param>
 18/// <param name="Coordinates">The geographic coordinates.</param>
 19public record Address(string? Street = null, string? PostalCode = null, string? City = null, Country? Country = null, Co
 20{
 21    /// <summary>
 22    /// Returns a string that represents the address, formatted as a space-separated list of the street, postal code,
 23    /// city, and country name.
 24    /// </summary>
 25    /// <remarks>This method concatenates the address components, ensuring that only non-empty values are
 26    /// included in the final output. The country name is accessed through the Country property, which may be
 27    /// null.</remarks>
 28    /// <returns>A string containing the formatted address. If any of the address components are null or empty, they are
 29    /// from the result.</returns>
 1230    public override string ToString() => string.Join(" ", new[] { Street, PostalCode, City, Country?.Name }.Where(x => !
 31}
 32

Methods/Properties

ToString()