Exemplo n.º 1
0
        public void GetGeneration_Throw_ElapsedIsNegative(int year, int month, int day, int hour, int minute, int second)
        {
            var createdDate = new DateTimeOffset(year, month, day, hour, minute, second, TimeSpan.Zero);

            Func <BackupGeneration> act = () => BackupGenerationsExtensions.GetGeneration(createdDate, _currentDate);

            act.Should().Throw <InvalidOperationException>().WithMessage("Elapsed can't be negative.");
        }
Exemplo n.º 2
0
        public void GetGeneration_FirstGen_Fail(int year, int month, int day, int hour, int minute, int second)
        {
            var createdDate = new DateTimeOffset(year, month, day, hour, minute, second, TimeSpan.Zero);

            var actual = BackupGenerationsExtensions.GetGeneration(createdDate, _currentDate);

            actual.Should().NotBe(BackupGeneration.First);
        }
Exemplo n.º 3
0
        public void GetGeneration_ThirdGen_BoundedValues(int year, int month, int day, int hour, int minute, int second)
        {
            var createdDate = new DateTimeOffset(year, month, day, hour, minute, second, TimeSpan.Zero);

            var actual = BackupGenerationsExtensions.GetGeneration(createdDate, _currentDate);

            actual.Should().Be(BackupGeneration.Third);
        }