示例#1
0
        public void ShouldBackupNow_MoreThan7DaysAway_ReturnsTrue()
        {
            TestableMyTimeBasedClass backup = new TestableMyTimeBasedClass();
            backup.LastBackup = new DateTime(2000,1,1);
            backup.CurrentTime = new DateTime(2000,1,9);

            bool backupNow = backup.ShouldBackupNow();
            Assert.IsTrue(backupNow);
        }
        public void ShouldBackupNow_LessThan7DaysAway_ReturnsFalse()
        {
            TestableMyTimeBasedClass backup = new TestableMyTimeBasedClass();

            backup.LastBackup  = new DateTime(2000, 1, 1);
            backup.CurrentTime = new DateTime(2000, 1, 5);

            bool backupNow = backup.ShouldBackupNow();

            Assert.IsFalse(backupNow);
        }