private void Validate(string content, VariableCollection overridenVariableCollection)
{
var variableKeyMatches = Regex.Matches(content, _variableKeyRegexPattern);
var validationFailed = false;
foreach (Match variableKeyMatch in variableKeyMatches)
{
var variableKey = variableKeyMatch.Value;
if (!overridenVariableCollection.ContainsKey(variableKey))
{
validationFailed = true;
Console.Error.WriteLine($"There is no value defined for the variable {variableKey}");
}
}
if (validationFailed)
{
throw new InvalidOperationException("There should be a value assigned to all variables");
}
}