public void ShouldBeValidWithAllData() { var uut = new UploadSettings { LastNotificationDate = DateTime.Now, LastUploadDate = DateTime.Now }; Assert.IsTrue(uut.IsInitialized()); }
public void ShouldBeInvalidWithoutLastUploadTime() { var uut = new UploadSettings { LastNotificationDate = DateTime.Now }; Assert.IsFalse(uut.IsInitialized()); }
public void ShouldInitializeSettingsIfNotInitialized() { _mockSettingsStore.Setup(store => store.GetSettings <UploadSettings>()).Returns(new UploadSettings()); WhenUploadReminderIsInitialized(); Assert.IsTrue(_updatedUploadSettings.IsInitialized()); }
public void ShouldInitializeWithCurrentDate() { var uut = new UploadSettings(); uut.Initialize(); var now = DateTimeOffset.Now; Assert.IsTrue(uut.IsInitialized()); Assert.IsTrue(GetDiffInMs(uut.LastNotificationDate, now) < 50); Assert.IsTrue(GetDiffInMs(uut.LastUploadDate, now) < 50); }
public void ShouldInitializeWithCurrentDate() { var uut = new UploadSettings(); uut.Initialize(); var dateTime = DateTime.Now; Assert.IsTrue(uut.IsInitialized()); var comparer = new SimilarDateTimeComparer(50); Assert.IsTrue(comparer.Equal(dateTime, uut.LastNotificationDate)); Assert.IsTrue(comparer.Equal(dateTime, uut.LastUploadDate)); }
public void ShouldBeInvalidWithoutData() { var uut = new UploadSettings(); Assert.IsFalse(uut.IsInitialized()); }