InvokeServerUnavailable() публичный Метод

public InvokeServerUnavailable ( ServerUnavailableException serverUnavailableException ) : void
serverUnavailableException ServerUnavailableException
Результат void
Пример #1
0
 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
                         ());
 }
Пример #2
0
 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);
 }
Пример #3
0
 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);
 }
Пример #4
0
 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);
 }
Пример #5
0
 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);
 }