< Summary

Information
Class: Morpho25.Settings.Cloud
Assembly: Morpho25
File(s): D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\Cloud.cs
Line coverage
97%
Covered lines: 36
Uncovered lines: 1
Coverable lines: 37
Total lines: 97
Line coverage: 97.2%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
IsMoreThanEight(...)75%4100%
get_LowClouds()100%1100%
set_LowClouds(...)100%1100%
get_MiddleClouds()100%1100%
set_MiddleClouds(...)100%1100%
get_HighClouds()100%1100%
set_HighClouds(...)100%1100%
.ctor()100%1100%
get_Title()100%1100%
get_Values()100%1100%
get_Tags()100%1100%
ToString()100%10%

File(s)

D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\Cloud.cs

#LineLine coverage
 1using System;
 2
 3
 4namespace Morpho25.Settings
 5{
 6    /// <summary>
 7    /// Cloud class.
 8    /// </summary>
 9    public class Cloud
 10    {
 11        private uint _lowClouds;
 12        private uint _middleClouds;
 13        private uint _highClouds;
 14
 15        private void IsMoreThanEight(double value)
 816        {
 817            if (value < 0 || value > 8)
 118                throw new ArgumentException("Value must be in range (0, 8).");
 719        }
 20        /// <summary>
 21        /// Fraction of LOW clouds (x/8).
 22        /// </summary>
 23        public uint LowClouds
 24        {
 325            get { return _lowClouds; }
 26            set
 227            {
 228                IsMoreThanEight(value);
 229                _lowClouds = value;
 230            }
 31        }
 32        /// <summary>
 33        /// Fraction of MIDDLE clouds (x/8).
 34        /// </summary>
 35        public uint MiddleClouds
 36        {
 337            get { return _middleClouds; }
 38            set
 239            {
 240                IsMoreThanEight(value);
 241                _middleClouds = value;
 242            }
 43        }
 44        /// <summary>
 45        /// Fraction of HIGH clouds (x/8).
 46        /// </summary>
 47        public uint HighClouds
 48        {
 949            get { return _highClouds; }
 50            set
 451            {
 452                IsMoreThanEight(value);
 353                _highClouds = value;
 354            }
 55        }
 56        /// <summary>
 57        /// Create new Cloud object.
 58        /// </summary>
 259        public Cloud()
 260        {
 261            LowClouds = 0;
 262            MiddleClouds = 0;
 263            HighClouds = 0;
 64
 265        }
 66
 67        /// <summary>
 68        /// Title of the XML section
 69        /// </summary>
 170        public string Title => "Clouds";
 71
 72        /// <summary>
 73        /// Values of the XML section
 74        /// </summary>
 175        public string[] Values => new[] {
 176            LowClouds.ToString("n5"),
 177            MiddleClouds.ToString("n5"),
 178            HighClouds.ToString("n5")
 179        };
 80
 81        /// <summary>
 82        /// Tags of the XML section
 83        /// </summary>
 184        public string[] Tags => new[] {
 185            "lowClouds",
 186            "middleClouds",
 187            "highClouds"
 188        };
 89
 90        /// <summary>
 91        /// String representation of Cloud object.
 92        /// </summary>
 93        /// <returns>String representation.</returns>
 094        public override string ToString() => $"Config::Cloud::{LowClouds},{MiddleClouds},{HighClouds}";
 95    }
 96
 97}