Пример #1
0
        public void TestPasswordArchive()
        {
            var    dataAction  = new DataAction(_dataPlace);
            string archivePath = _testedData.DirDestination + "\\mytest.zip";

            dataAction.ArchiveTo(archivePath);

            var verificator = new DataVerificator(_testedData);

            Assert.IsTrue(verificator.testArchive(archivePath));
        }
Пример #2
0
        public void TestLockFile()
        {
            using (FileStream fileStream = new FileStream(
                       _testedData.PreparedFiles[0],
                       FileMode.OpenOrCreate,
                       FileAccess.ReadWrite,
                       FileShare.ReadWrite))
            {
                var    dataAction  = new DataAction(_dataPlace);
                string archivePath = _testedData.DirDestination + "\\mytest.zip";
                dataAction.ArchiveTo(archivePath);

                var verificator = new DataVerificator(_testedData);
                Assert.IsTrue(verificator.testArchive(archivePath));
            }
        }
Пример #3
0
        public void TestEncryptedArchives()
        {
            var newConfig = _config;

            newConfig.usePassword   = true;
            newConfig.password      = "******";
            newConfig.backupToPath += "\\test.zip";


            var backupRule   = new BackupRule(_dataPlace, newConfig);
            var backupAction = new BackupAction(_dataPlace, newConfig);

            var backuper = new Backuper(backupAction, backupRule);

            backupAction.Backup();

            var verificator = new DataVerificator(_testedData);

            Assert.Catch <InvalidDataException>(() => verificator.testArchive(newConfig.backupToPath));
            Assert.IsTrue(verificator.testEncryptedArchive(newConfig.backupToPath, newConfig.password));
        }