< Summary

Information
Class: ValidateLib.ErrorsAndWarnings.Errors.ValidationErrors.NotAllReferencedValuesExistValidationError
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\ErrorsAndWarnings\Errors\ValidationErrors\NotAllReferencedValuesExistValidationError.cs
Line coverage
31%
Covered lines: 5
Uncovered lines: 11
Coverable lines: 16
Total lines: 38
Line coverage: 31.2%
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
NotAllReferencedValuesExistValidationError(...)20
GetMessage(...)021

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\ErrorsAndWarnings\Errors\ValidationErrors\NotAllReferencedValuesExistValidationError.cs

#LineLine coverage
 1using System.Globalization;
 2using System.Text;
 3using ValidateLib.TabularData.AnnotatedTabularDataModel;
 4
 5namespace ValidateLib.ErrorsAndWarnings.Errors.ValidationErrors
 6{
 7    public class NotAllReferencedValuesExistValidationError : ValidationError
 8    {
 9        Table referencedTable;
 10        Table referencingTable;
 11        Dictionary<string, bool> referencingValues;
 112        public NotAllReferencedValuesExistValidationError(Table referencedTable, Table referencingTable, Dictionary<stri
 13        {
 114            this.referencedTable = referencedTable;
 115            this.referencingTable = referencingTable;
 116            this.referencingValues = referencingValues;
 117        }
 18
 19        public override string GetMessage(CultureInfo cultureInfo)
 20        {
 021            StringBuilder sb = new StringBuilder();
 022            foreach (KeyValuePair<string, bool> kvp in referencingValues)
 23            {
 024                if (kvp.Value == true)
 25                {
 026                    sb.Append("\n");
 027                    sb.Append(kvp.Key);
 28                }
 29            }
 030            return GetMessageWithParams(nameof(NotAllReferencedValuesExistValidationError),
 031                cultureInfo,
 032                referencingTable.url,
 033                referencingTable.url,
 034                sb.ToString()
 035                );
 36        }
 37    }
 38}