< Summary

Information
Class: Morpho25.Settings.Sources
Assembly: Morpho25
File(s): D:\a\Morpho\Morpho\project\Morpho\Morpho25\Settings\Sources.cs
Line coverage
97%
Covered lines: 42
Uncovered lines: 1
Coverable lines: 43
Total lines: 109
Line coverage: 97.6%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_UserPolluName()100%1100%
get_UserPolluType()100%1100%
get_ActiveChem()100%1100%
get_MultipleSources()100%1100%
get_UserPartDiameter()100%1100%
set_UserPartDiameter(...)100%1100%
get_UserPartDensity()100%1100%
set_UserPartDensity(...)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\Sources.cs

#LineLine coverage
 1namespace Morpho25.Settings
 2{
 3    /// <summary>
 4    /// Sources settings class.
 5    /// </summary>
 6    public class Sources : Configuration
 7    {
 8        /// <summary>
 9        /// Isoprene index.
 10        /// </summary>
 11        public const string ISOPRENE = "0";
 12
 13        /// <summary>
 14        /// User pollutant name.
 15        /// </summary>
 416        public string UserPolluName { get; set; }
 17
 18        /// <summary>
 19        /// User pollutant type.
 20        /// </summary>
 521        public Pollutant UserPolluType { get; set; }
 22
 23        /// <summary>
 24        /// Dispersion and active chemistry
 25        /// </summary>
 326        public Active ActiveChem { get; set; }
 27
 28        private double _userPartDiameter;
 29        private double _userPartDensity;
 30        /// <summary>
 31        /// Multiple source types.
 32        /// </summary>
 333        public Active MultipleSources { get; set; }
 34        /// <summary>
 35        /// Particle diameter (μm).
 36        /// </summary>
 37        public double UserPartDiameter
 38        {
 339            get { return _userPartDiameter; }
 40            set
 241            {
 242                ItIsPositive(value);
 243                _userPartDiameter = value;
 244            }
 45        }
 46        /// <summary>
 47        /// Particle density (g/cm3).
 48        /// </summary>
 49        public double UserPartDensity
 50        {
 351            get { return _userPartDensity; }
 52            set
 253            {
 254                ItIsPositive(value);
 255                _userPartDensity = value;
 256            }
 57        }
 58        /// <summary>
 59        /// Create new Pollutant.
 60        /// </summary>
 261        public Sources()
 262        {
 263            UserPolluName = "My Pollutant";
 264            UserPolluType = Pollutant.CO2;
 265            UserPartDiameter = 10.0;
 266            UserPartDensity = 1.0;
 267            MultipleSources = Active.YES;
 268            ActiveChem = Active.YES;
 269        }
 70
 71        /// <summary>
 72        /// Title of the XML section
 73        /// </summary>
 174        public string Title => "Sources";
 75
 76        /// <summary>
 77        /// Values of the XML section
 78        /// </summary>
 179        public string[] Values => new[] {
 180            UserPolluName,
 181            ((int)UserPolluType).ToString(),
 182            UserPartDiameter.ToString("n5"),
 183            UserPartDensity.ToString("n5"),
 184            ((int)MultipleSources).ToString(),
 185            ((int)ActiveChem).ToString(),
 186            ISOPRENE
 187        };
 88
 89        /// <summary>
 90        /// Tags of the XML section
 91        /// </summary>
 192        public string[] Tags => new[] {
 193            "userPolluName",
 194            "userPolluType",
 195            "userPartDiameter",
 196            "userPartDensity",
 197            "multipleSources",
 198            "activeChem",
 199            "isoprene"
 1100        };
 101
 102        /// <summary>
 103        /// String representation of Pollutant object.
 104        /// </summary>
 105        /// <returns>String representation.</returns>
 0106        public override string ToString() => $"Config::Sources::{UserPolluName}";
 107    }
 108
 109}