< Summary - SonghayCore

Information
Class: Songhay.Models.ProgramMetadata
Assembly: SonghayCore
File(s): /home/rasx/sourceRoot/SonghayCore/SonghayCore/Models/ProgramMetadata.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 43
Coverable lines: 43
Total lines: 72
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 22
Branch coverage: 0%
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_CloudStorageSet()100%10%
get_DbmsSet()100%10%
get_RestApiMetadataSet()100%10%
ToString()0%220%

File(s)

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Models/ProgramMetadata.cs

#LineLine coverage
 1namespace Songhay.Models;
 2
 3/// <summary>
 4/// Defines the conventional Program metadata.
 5/// </summary>
 6public class ProgramMetadata
 7{
 8    /// <summary>
 9    /// Gets or sets the cloud storage set.
 10    /// </summary>
 011    public Dictionary<string, Dictionary<string, string>> CloudStorageSet { get; set; } = new();
 12
 13    /// <summary>
 14    /// Gets or sets the DBMS set.
 15    /// </summary>
 016    public Dictionary<string, DbmsMetadata> DbmsSet { get; set; } = new();
 17
 18    /// <summary>
 19    /// Gets or sets the REST API metadata set.
 20    /// </summary>
 021    public Dictionary<string, RestApiMetadata> RestApiMetadataSet { get; set; } = new();
 22
 23    /// <summary>
 24    /// Represents this instance as a <c>string</c>.
 25    /// </summary>
 26    public override string ToString()
 027    {
 028        var sb = new StringBuilder();
 29
 030        if (CloudStorageSet.Any())
 031        {
 032            sb.AppendLine($"{nameof(CloudStorageSet)}:");
 033            foreach (var item in CloudStorageSet)
 034            {
 035                sb.AppendLine($"    {item.Key}:");
 036                if (item.Value.Any())
 037                {
 038                    foreach (var item2 in item.Value)
 039                    {
 040                        var maxLength = 64;
 041                        if (item2.Value.Length >= maxLength)
 042                            sb.AppendLine($"        {item2.Key}: {item2.Value.Substring(0, maxLength)}... ");
 43                        else
 044                            sb.AppendLine($"        {item2.Key}: {item2.Value}... ");
 045                    }
 046                }
 047            }
 048        }
 49
 050        if (DbmsSet.Any())
 051        {
 052            sb.AppendLine($"{nameof(DbmsSet)}:");
 053            foreach (var item in DbmsSet)
 054            {
 055                sb.AppendLine($"    {item.Key}:");
 056                sb.AppendLine($"        {item.Value}");
 057            }
 058        }
 59
 060        if (RestApiMetadataSet.Any())
 061        {
 062            sb.AppendLine($"{nameof(RestApiMetadataSet)}:");
 063            foreach (var item in RestApiMetadataSet)
 064            {
 065                sb.AppendLine($"    {item.Key}:");
 066                sb.AppendLine($"        {item.Value}");
 067            }
 068        }
 69
 070        return sb.Length > 0 ? sb.ToString() : base.ToString() ?? GetType().Name;
 071    }
 72}