コード例 #1
0
        public void ShouldBeValidWithAllData()
        {
            var uut = new UploadSettings {
                LastNotificationDate = DateTime.Now, LastUploadDate = DateTime.Now
            };

            Assert.IsTrue(uut.IsInitialized());
        }
コード例 #2
0
        public void ShouldBeInvalidWithoutLastUploadTime()
        {
            var uut = new UploadSettings {
                LastNotificationDate = DateTime.Now
            };

            Assert.IsFalse(uut.IsInitialized());
        }
コード例 #3
0
        public void ShouldInitializeSettingsIfNotInitialized()
        {
            _mockSettingsStore.Setup(store => store.GetSettings <UploadSettings>()).Returns(new UploadSettings());

            WhenUploadReminderIsInitialized();

            Assert.IsTrue(_updatedUploadSettings.IsInitialized());
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        public void ShouldBeInvalidWithoutData()
        {
            var uut = new UploadSettings();

            Assert.IsFalse(uut.IsInitialized());
        }