예제 #1
0
        public void GetRestoreFileForNoTimeStamp()
        {
            this.File.CreatePlaceHolder();
            this.Backup.CreatePlaceHolder();
            var restore = BackupFile.GetRestoreFileFor(this.File, Default.BackupSettings(this.Directory));

            Assert.AreEqual(this.Backup.FullName, restore.FullName);
        }
예제 #2
0
        public void GetRestoreFileForNoTimeStamp()
        {
            File.VoidCreate();
            Backup.VoidCreate();
            var restore = BackupFile.GetRestoreFileFor(File, Setting);

            Assert.AreEqual(Backup.FullName, restore.FullName);
        }
예제 #3
0
        public static void GetRestoreFileForNoTimeStamp()
        {
            var file   = CreateFile();
            var backup = CreateBackupFile();

            file.CreateFileOnDisk();
            backup.CreateFileOnDisk();
            var restore = BackupFile.GetRestoreFileFor(file, Default.BackupSettings(Directory));

            Assert.AreEqual(backup.FullName, restore !.FullName);
        }
예제 #4
0
        public void GetRestoreFileFor()
        {
            Setting.TimeStampFormat = BackupSettings.DefaultTimeStampFormat;
            File.VoidCreate();
            foreach (var backup in TimestampedBackups)
            {
                backup.VoidCreate();
            }
            var restore = BackupFile.GetRestoreFileFor(File, Setting);

            Assert.AreEqual(BackupOneMinuteOld.FullName, restore.FullName);
        }
예제 #5
0
        public void GetRestoreFileFor()
        {
            _setting.TimeStampFormat = BackupSettings.DefaultTimeStampFormat;
            _file.VoidCreate();
            foreach (var backup in _timestampedBackups)
            {
                backup.VoidCreate();
            }
            var restore = BackupFile.GetRestoreFileFor(_file, _setting);

            Assert.AreEqual(_backup1.FullName, restore.FullName);
        }
예제 #6
0
        public void GetRestoreFileFor()
        {
            this.File.CreatePlaceHolder();
            foreach (var backup in this.TimestampedBackups)
            {
                backup.CreatePlaceHolder();
            }

            var backupSettings = new BackupSettings(this.Directory.FullName, BackupSettings.DefaultExtension, BackupSettings.DefaultTimeStampFormat, 1, 1);
            var restore        = BackupFile.GetRestoreFileFor(this.File, backupSettings);

            Assert.AreEqual(this.BackupOneMinuteOld.FullName, restore.FullName);
        }
예제 #7
0
        public static void GetRestoreFileFor()
        {
            var settings = new BackupSettings(Directory.FullName, BackupSettings.DefaultExtension, BackupSettings.DefaultTimeStampFormat, 1, 1);
            var file     = CreateFile();
            var backup   = CreateBackupFile();

            file.CreateFileOnDisk();
            var backupOneMinuteOld = backup.WithTimeStamp(DateTime.Now.AddMinutes(-1), settings);

            backupOneMinuteOld.CreateFileOnDisk();
            backup.WithTimeStamp(DateTime.Now.AddHours(-1), settings).CreateFileOnDisk();
            backup.WithTimeStamp(DateTime.Now.AddDays(-1), settings).CreateFileOnDisk();
            backup.WithTimeStamp(DateTime.Now.AddMonths(-1), settings).CreateFileOnDisk();
            backup.WithTimeStamp(DateTime.Now.AddYears(-1), settings).CreateFileOnDisk();

            var restore = BackupFile.GetRestoreFileFor(file, settings);

            Assert.AreEqual(backupOneMinuteOld.FullName, restore !.FullName);
        }