Example #1
0
        public void Test1()
        {
            BackupManager manager = new BackupManager();
            Backup        backup1 = new Backup();

            manager.addBackup(backup1);

            backup1.AddFiles("D:\\учебники\\универ английский\\Empower_A2_Student's Book.pdf");
            backup1.AddFiles("D:\\учебники\\discr_math.pdf");
            Assert.AreEqual(2, backup1.FileList.Count);

            manager.SplitCopyАlgorithm(backup1, false);

            AmountRemoveAlgorithm alg1    = new AmountRemoveAlgorithm(backup1, 1);
            Cleaner <IAlgorithms> cleaner = new Cleaner <IAlgorithms>(alg1);

            cleaner.RemovePoint(backup1, alg1.GetExtraPoint());
            Assert.AreEqual(1, backup1.RestorePointsList.Count);
        }
Example #2
0
        public void Test3Hybrid()
        {
            BackupManager manager = new BackupManager();
            Backup        backup1 = new Backup();

            manager.addBackup(backup1);

            backup1.AddFiles("D:\\10mb-file.txt");
            backup1.AddFiles("D:\\10mb-file2.txt");
            backup1.AddFiles("D:\\учебники\\универ английский\\Empower_A2_Student's Book.pdf");

            manager.SplitCopyАlgorithm(backup1, false);
            manager.SplitCopyАlgorithm(backup1, false);
            manager.SplitCopyАlgorithm(backup1, false);

            SizeRemoveAlgorithm   alg1 = new SizeRemoveAlgorithm(backup1, (long)1.5e+7);
            AmountRemoveAlgorithm alg2 = new AmountRemoveAlgorithm(backup1, 1);

            Cleaner <IAlgorithms> cleaner = new Cleaner <IAlgorithms>(alg1, alg2);

            cleaner.RemovePoint(backup1, cleaner.GetExtraPoint(false));
            Assert.AreEqual(1, backup1.RestorePointsList.Count);
        }