Example #1
0
 public void TestAdd2()
 {
     _viewModel.Notifications.Should().BeEmpty();
     _actionCenter.Add(Notification.CreateInfo("Foo", "Hello World!"));
     _dispatcher.InvokeAll();
     _viewModel.Notifications.Count().Should().Be(1);
     _viewModel.UnreadCount.Should().Be(1);
     _viewModel.HasNewMessages.Should().BeTrue();
 }
Example #2
0
        public void TestUpdateAvailable1()
        {
            var changes = new List <string>();

            _mainWindow.AutoUpdater.PropertyChanged += (sender, args) => changes.Add(args.PropertyName);
            _updater.Setup(x => x.AppVersion).Returns(new Version(1, 0, 0));
            _updater.Raise(x => x.LatestVersionChanged += null, new VersionInfo(null, null, new Version(1, 0, 1), null));

            _mainWindow.AutoUpdater.IsUpdateAvailable.Should().BeFalse("Because these changes should be dispatched first");
            _mainWindow.AutoUpdater.ShowUpdateAvailable.Should().BeFalse("Because these changes should be dispatched first");

            _dispatcher.InvokeAll();
            _mainWindow.AutoUpdater.IsUpdateAvailable.Should().BeTrue();
            _mainWindow.AutoUpdater.ShowUpdateAvailable.Should().BeTrue();
            changes.Should().BeEquivalentTo(new object[] { "ShowUpdateAvailable", "IsUpdateAvailable", "LatestVersion" });
        }