Beispiel #1
0
        public void UpdateAsync_UpdateTimeIsNotZero()
        {
            Mock <IChannelInfoProvider> providerMock = BuildChannelInfoProvider(DefaultReleaseChannel, NoUpgradeChannelInfo);
            AutoUpdate update = BuildAutoUpdate(channelProvider: providerMock.Object);

            // ensure that the UpdateTime is 0 before calling UpdateAsync
            TimeSpan?updateTime = update.GetUpdateTime();

            Assert.IsTrue(updateTime.HasValue);
            Assert.AreEqual(TimeSpan.Zero, updateTime.Value);

            update.UpdateAsync().Wait();

            // ensure that the UpdateTime is not 0 after calling UpdateAsync
            updateTime = update.GetUpdateTime();
            Assert.IsTrue(updateTime.HasValue);
            Assert.AreNotEqual(TimeSpan.Zero, updateTime.Value);
            providerMock.VerifyAll();
        }