< Summary

Information
Class: ValidateLib.ErrorsAndWarnings.Warnings.Warning
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\ErrorsAndWarnings\Warnings\Warning.cs
Line coverage
87%
Covered lines: 7
Uncovered lines: 1
Coverable lines: 8
Total lines: 35
Line coverage: 87.5%
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

MethodBlocks covered Blocks not covered
Warning()90
Warning()20
GetMessageWithParams(...)50
GetErrorType()10

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\ErrorsAndWarnings\Warnings\Warning.cs

#LineLine coverage
 1using System.Globalization;
 2using System.Resources;
 3
 4namespace ValidateLib.ErrorsAndWarnings.Warnings
 5{
 6    public class Warning : ErrorOrWarning
 7    {
 18        public string? AdditionalInfo { get; set; }
 19        public static ResourceManager WarningManager = new ResourceManager(EWConstants.WarningResources, typeof(Warning)
 010        static ResourceManager _ResourceManager { get; set; } =
 111                    new ResourceManager(EWConstants.PathToResources, typeof(Warning).Assembly);
 12        /// <summary>
 13        /// Prefix of warning message. Currently empty.
 14        /// </summary>
 115        protected string WarningMessagePrefix { get; set; } = "";
 16        /// <summary>
 17        /// Returns localized error message with parameters formated in the string.
 18        /// </summary>
 19        /// <param name="className"> Name of the class that is index in the .resx file.</param>
 20        /// <param name="cultureInfo"> Culture in which we want to have localized the message.</param>
 21        /// <param name="stringArgs"> Arguments of the message. </param>
 22        /// <returns> Localized error message. </returns>
 23        protected string GetMessageWithParams(string className, CultureInfo cultureInfo, params object?[] stringArgs)
 24        {
 125            string message = WarningMessagePrefix + WarningManager.GetString(className, cultureInfo)!;
 126            return string.Format(message, stringArgs);
 27        }
 28        public override ErrorType GetErrorType()
 29        {
 130            return ErrorType.WARNING;
 31        }
 32
 33
 34    }
 35}