예제 #1
0
 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
 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>();
 }
예제 #4
0
 public void ExtraInDatabase(string found, CompareAttributes attribute, string name = null)
 {
     AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.ExtraInDatabase, name ?? _defaultName, attribute, null, found));
 }
예제 #5
0
 public void NotInDatabase(string expected, CompareAttributes attribute = CompareAttributes.NotSet, string name = null)
 {
     AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.NotInDatabase, name ?? _defaultName, attribute, expected, null));
 }
예제 #6
0
 public void Different(string expected, string found, CompareAttributes attribute, string name = null)
 {
     AddToLogsIfNotIgnored(new CompareLog(_type, CompareState.Different, name ?? _defaultName, attribute, expected, found));
 }
예제 #7
0
 /// <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));
 }