예제 #1
0
            public void SelectPstFiles_WhenFileHasNeverBeenSaved()
            {
                // Arrange
                _PstFilesToSave.Clear();
                _PstFilesToNotSave.Clear();
                _allPstFiles.Clear();
                _allPstFiles.Add(new PSTRegistryEntry(String.Empty));
                SUT coreEngine = new SUT(appSettings);

                // Act
                coreEngine.SelectPstFilesToSave(_allPstFiles, out _PstFilesToSave, out _PstFilesToNotSave);

                // Assert
                Assert.IsTrue(_PstFilesToSave.Count == 1);
                Assert.IsTrue(_PstFilesToSave[0].ToBackup);
                Assert.IsTrue(_PstFilesToNotSave.Count == 0);
            }
예제 #2
0
            public void SelectPstFiles_WhenLastSuccessfulBackupIsExpired()
            {
                // Arrange
                _PstFilesToSave.Clear();
                _PstFilesToNotSave.Clear();
                SUT coreEngine = new SUT(appSettings);

                // Act
                coreEngine.SelectPstFilesToSave(_allPstFiles, out _PstFilesToSave, out _PstFilesToNotSave);

                // Assert
                Assert.IsTrue(_PstFilesToSave.Count == 1);
                Assert.IsTrue(_PstFilesToSave[0].ToBackup);
                Assert.AreEqual(DateTime.Now.AddMonths(-1).Date, _PstFilesToSave[0].LastSuccessfulBackup.Date);
                Assert.AreEqual(DateTime.Now.AddMonths(-1).Month, _PstFilesToSave[0].LastSuccessfulBackup.Month);
                Assert.AreEqual(DateTime.Now.AddMonths(-1).Year, _PstFilesToSave[0].LastSuccessfulBackup.Year);
                Assert.IsTrue(_PstFilesToNotSave.Count == 5);
            }