public bool CheckDifferent(string expected, string found, CompareAttributes attribute, string name = null) { if (expected != found && expected?.Replace(" ", "") != found?.Replace(" ", "")) { AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.Different, name ?? _defaultName, attribute, expected, found)); return(true); } return(false); }
public bool CheckDifferent(string expected, string found, CompareAttributes attribute, StringComparison caseComparison, string name = null) { if (!string.Equals(expected, found, caseComparison) && !string.Equals(expected?.Replace(" ", ""), found?.Replace(" ", ""), caseComparison)) { return(AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.Different, name ?? _defaultName, attribute, expected, found))); } return(false); }
public CompareLog(CompareType type, CompareState state, string name, CompareAttributes attribute = CompareAttributes.MatchAnything, string expected = null, string found = null) { Type = type; State = state; Name = name; Attribute = attribute; Expected = expected; Found = found; SubLogs = new List <CompareLog>(); }
public void ExtraInDatabase(string found, CompareAttributes attribute, string name = null) { AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.ExtraInDatabase, name ?? _defaultName, attribute, null, found)); }
public void NotInDatabase(string expected, CompareAttributes attribute = CompareAttributes.NotSet, string name = null) { AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.NotInDatabase, name ?? _defaultName, attribute, expected, null)); }
public void Different(string expected, string found, CompareAttributes attribute, string name = null) { AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.Different, name ?? _defaultName, attribute, expected, found)); }
/// <summary> /// This is for adding a Not Checked log. /// </summary> /// <param name="errorMessage">What we don't check</param> /// <param name="found">entities that aren't checked</param> /// <param name="attribute"></param> public void MarkAsNotChecked(string errorMessage, string found, CompareAttributes attribute) { AddToLogsIfNotIgnored(new CompareLog(CompareType.Entity, CompareState.NotChecked, found, attribute, null, found)); }