예제 #1
0
        public void TestDirDiff()
        {
            var ll = new BackupLib.LocalLister();
            var fl = ll.getList("c:\\tmp");

            var dd = new BackupLib.DirDiff();

            /* so, the 2nd list is expected to come from the uploaded set
             * and have an uploaded date (which won't necessarily be the modified date)
             */
            var fl1 = new List <FreezeFile>();

            foreach (var ff in fl)
            {
                fl1.Add(new FreezeFile
                {
                    fileID     = ff.path
                    , path     = ff.path
                    , uploaded = ff.modified
                });
            }

            var cmpres = dd.compare(fl, fl1);

            Assert.IsNotNull(cmpres);
            Assert.IsTrue(cmpres.Count == 0);
        }
예제 #2
0
        public void TestDirDiffD()
        {
            var ll = new BackupLib.LocalLister();
            var fl = ll.getList("c:\\tmp");

            var fl2 = new List <FreezeFile>(fl);

            fl2.Add(new FreezeFile {
                path = "blarg/foo.jpg"
            });

            var dd     = new BackupLib.DirDiff();
            var cmpres = dd.compare(fl, fl2);

            Assert.IsNotNull(cmpres);
            Assert.IsTrue(cmpres.Count > 0);

            var x = cmpres.FirstOrDefault();

            Assert.IsNotNull(x);
        }