InvokeServerUnavailable() public method

public InvokeServerUnavailable ( ServerUnavailableException serverUnavailableException ) : void
serverUnavailableException ServerUnavailableException
return void
Ejemplo n.º 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
                         ());
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }