public void AlterListShouldRemoveItemsWithNotModifiedStatusTest() { var modificator = new UnmodifiedRemover(); var addedFile = new PerFileModification() { Modification = EFileModification.Added }; var removedFile = new PerFileModification() { Modification = EFileModification.Removed }; var unchangedFile = new PerFileModification() { Modification = EFileModification.NoChange }; var input = new List <PerFileModification>() { addedFile, removedFile, unchangedFile }; var result = modificator.AlterList(input); Assert.IsTrue(result.Count == 2); Assert.IsTrue(result.Contains(unchangedFile) == false); }
public PerFileModification Classify(InfoPair pair) { EFileModification modification; var result = new PerFileModification() { Filename = pair.FileName }; if (pair.OldFileHash == null) { modification = EFileModification.Added; } else if (pair.NewFileHash == null) { modification = EFileModification.Removed; } else if (pair.NewFileHash.Equals(pair.OldFileHash)) { modification = EFileModification.NoChange; } else { modification = EFileModification.Modified; } result.Modification = modification; return(result); }
public string Convert(PerFileModification item) { return(item.ToString()); }