private void SetIsOnline(bool isOnline) { toolStripStatusLabelOffline.Visible = !isOnline; if (!isOnline) { return; } _updateClient.CheckForUpdateAsync(); }
public void TestUpdateFound() { _updater.CurrentVersion = new Version(0, 0, 0, 0); _updater.IsPortable = true; _updater.CheckForUpdateAsync(); var gotResponse = _barrier.Wait(TimeSpan.FromSeconds(5)); Assert.IsTrue(gotResponse, "Did not receive a response from the update server within 5 seconds"); Assert.IsNotNull(_updater.LatestUpdate); Assert.IsTrue(_updater.IsUpdateAvailable, "Expected an update to be available"); Assert.Greater(_updater.LatestUpdate.Version, _updater.CurrentVersion, "LatestUpdate.Version should be greater than CurrentVersion"); Assert.AreEqual("Checking;UpdateFound;Checked;", _events); // Assert.IsTrue(_updater.LatestUpdate.FileName.EndsWith(".zip"), "LatestUpdate.FileName should end with \".zip\""); }