42 lines
1.7 KiB
C#
42 lines
1.7 KiB
C#
|
namespace AssortValidator.Common.Helpers
|
|||
|
{
|
|||
|
public static class ValueCheckerHelper
|
|||
|
{
|
|||
|
public static void CheckValuesMatch(string firstValue, string secondValue, string message, string associatedId = "", bool performTemplateIdLookup = false)
|
|||
|
{
|
|||
|
if (firstValue != secondValue)
|
|||
|
{
|
|||
|
if (performTemplateIdLookup)
|
|||
|
{
|
|||
|
firstValue = $"{firstValue} ({ItemTemplateHelper.GetTemplateById(firstValue)._name})";
|
|||
|
secondValue = $"{secondValue} ({ItemTemplateHelper.GetTemplateById(secondValue)._name})";
|
|||
|
}
|
|||
|
if (associatedId == string.Empty)
|
|||
|
{
|
|||
|
LoggingHelpers.LogWarning($"WARNING {message}: '{firstValue}', expected '{secondValue}'");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
LoggingHelpers.LogWarning($"WARNING {associatedId} {message}: '{firstValue}', expected '{secondValue}'");
|
|||
|
}
|
|||
|
}
|
|||
|
//LoggingHelpers.LogSuccess($"MATCH {firstValue} - {secondValue}");
|
|||
|
}
|
|||
|
|
|||
|
public static void CheckValuesMatch(int firstValue, int secondValue, string message, string associatedId = "")
|
|||
|
{
|
|||
|
if (firstValue != secondValue)
|
|||
|
{
|
|||
|
if (associatedId == string.Empty)
|
|||
|
{
|
|||
|
LoggingHelpers.LogWarning($"WARNING {message}: '{firstValue}', expected '{secondValue}'");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
LoggingHelpers.LogWarning($"WARNING {associatedId} {message}: '{firstValue}', expected '{secondValue}'");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|