public void CompareEqual() { //given var duplicateResult1 = new DuplicateResult(10); duplicateResult1.AddUnit("1.txt", 5); duplicateResult1.AddUnit("2.txt", 6); var duplicateResult2 = new DuplicateResult(10); duplicateResult2.AddUnit("1.txt", 5); duplicateResult2.AddUnit("2.txt", 6); //then Assert.IsTrue(duplicateResult1.CompareTo(duplicateResult2) == 0); }
public void CompareDifferentFileNames() { //given var duplicateResult1 = new DuplicateResult(10); duplicateResult1.AddUnit("1.txt", 5); duplicateResult1.AddUnit("2.txt", 6); var duplicateResult2 = new DuplicateResult(10); duplicateResult2.AddUnit("2.txt", 5); duplicateResult2.AddUnit("3.txt", 6); //then Assert.That(duplicateResult1.CompareTo(duplicateResult2), Is.EqualTo(-1)); Assert.That(duplicateResult2.CompareTo(duplicateResult1), Is.EqualTo(1)); }