public InvokeServerUnavailable ( ServerUnavailableException serverUnavailableException ) : void | ||
serverUnavailableException | ServerUnavailableException | |
Результат | void |
public void ServerUnavailableThenAvailableThenUnavailable_TwoUnavailableTrayNotificationSent() { var rulesEngine = new RulesEngineWrapper(); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); rulesEngine.InvokeStatusChecked(new BuildStatus[] { }); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); Assert.AreEqual(3, rulesEngine.TrayNotificationEvents.Count); Assert.AreEqual(2, rulesEngine.TrayNotificationEvents.Where(tn => tn.Title == "Build Server Unavailable").Count ()); }
public void InitialServerUnavailable_DisconnectedTrayNotificationSent() { var rulesEngine = new RulesEngineWrapper(); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); Assert.AreEqual(1, rulesEngine.TrayNotificationEvents.Count); var trayNotification = rulesEngine.TrayNotificationEvents[0]; Assert.AreEqual("Build Server Unavailable", trayNotification.Title); Assert.AreEqual("The connection will be restored when possible.", trayNotification.TipText); Assert.AreEqual(ToolTipIcon.Error, trayNotification.TipIcon); }
public void ServerUnavailableThenBecomesAvailable_ReconnectedTrayNotificationSent() { var rulesEngine = new RulesEngineWrapper(); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); rulesEngine.InvokeStatusChecked(new BuildStatus[] { }); Assert.AreEqual(2, rulesEngine.TrayNotificationEvents.Count); var trayNotification = rulesEngine.TrayNotificationEvents[1]; Assert.AreEqual("Reconnected", trayNotification.Title); Assert.AreEqual("Reconnected to server.", trayNotification.TipText); Assert.AreEqual(ToolTipIcon.Info, trayNotification.TipIcon); }
public void ServerUnavailableTwice_OnlyOneTrayNotificationSent() { var rulesEngine = new RulesEngineWrapper(); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); Assert.AreEqual(1, rulesEngine.TrayNotificationEvents.Count); }
public void ServerUnavailableThenAvailableTwice_OnlyOneReconnectedTrayNotification() { var rulesEngine = new RulesEngineWrapper(); rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down.")); rulesEngine.InvokeStatusChecked(new BuildStatus[] { }); rulesEngine.InvokeStatusChecked(new BuildStatus[] { }); Assert.AreEqual(2, rulesEngine.TrayNotificationEvents.Count); }