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."); }
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); }
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); }