Example #1
0
        public void ComparisonPartialyLoaded()
        {
            // ref
            DocumentIdentity docA = new DocumentIdentity();
            docA.FilePath = Path.GetFullPath(fileA);
            // same file
            DocumentIdentity docAbis = new DocumentIdentity();
            docAbis.FilePath = Path.GetFullPath(fileA);
            Assert.IsTrue(docA.CompareTo(docAbis) == 0, "Same files");
            
            // File differ
            DocumentIdentity docB = new DocumentIdentity();
            docB.FilePath = Path.GetFullPath(fileB);
            Assert.IsFalse(docA.CompareTo(docB) == 0, "Not same files");

        }
Example #2
0
        public void ComparisonChecksum()
        {
            //Ref
            DocumentIdentity docA = new DocumentIdentity();
            docA.FilePath = Path.GetFullPath(fileA);
            docA.State = IndexationStates.Indexed;
            docA.Checksum = "AAAA";
            
            // Same checksum
            DocumentIdentity docB = new DocumentIdentity();
            docB.FilePath = Path.GetFullPath(fileA);
            docB.State = IndexationStates.Indexed;
            docB.Checksum = "AAAA";
            Assert.IsTrue(docA.CompareTo(docB) == 0, "Same files");
            
            // Same file, checksum differt
            DocumentIdentity docC = new DocumentIdentity();
            docC.FilePath = Path.GetFullPath(fileA);
            docC.State = IndexationStates.Indexed;
            docC.Checksum = "CCCC";
            Assert.IsFalse(docA.CompareTo(docC) == 0, "Not same files");

        }