public void BotHaseDisconnected(bool StandAlone = true)
        {
            Proxy.Disconnect();
            //if (!Proxy.StandAlone)
            //    HaltFor(CleanupDelayTime);

            Assert.Multiple(() =>
            {
                Assert.That(Proxy.ServerStatus,
                            Is.EqualTo(ConnectionPhase.Disconnected),
                            $"Proxy.ServerStatus {Proxy.ServerStatus}");
                Assert.That(Proxy.IsServerSocketConnected,
                            Is.EqualTo(false),
                            $"Proxy.IsServerSocketConnected {Proxy.IsServerSocketConnected}");
                Assert.That(Proxy.ClientStatus,
                            Is.EqualTo(ConnectionPhase.Disconnected),
                            $"Proxy.ClientStatus {Proxy.ClientStatus}");
                Assert.That(Proxy.IsClientSocketConnected,
                            Is.EqualTo(false),
                            $"Proxy.IsClientSocketConnected {Proxy.IsClientSocketConnected}");
                Assert.That(Proxy.FurcadiaClientIsRunning,
                            Is.EqualTo(false),
                            $"Proxy.FurcadiaClientIsRunning {Proxy.FurcadiaClientIsRunning}");
            });
        }
示例#2
0
 public void DisconnectTests()
 {
     Proxy.ServerStatusChanged += (sender, e) =>
     {
         if (e.ConnectPhase == ConnectionPhase.Disconnected)
         {
             Assert.Multiple(() =>
             {
                 Assert.That(Proxy.ServerStatus,
                             Is.EqualTo(ConnectionPhase.Disconnected),
                             $"Proxy.ServerStatus {Proxy.ServerStatus}");
                 Assert.That(Proxy.IsServerSocketConnected,
                             Is.EqualTo(false),
                             $"Proxy.IsServerSocketConnected {Proxy.IsServerSocketConnected}");
                 Assert.That(Proxy.ClientStatus,
                             Is.EqualTo(ConnectionPhase.Disconnected),
                             $"Proxy.ClientStatus {Proxy.ClientStatus}");
                 Assert.That(Proxy.IsClientSocketConnected,
                             Is.EqualTo(false),
                             $"Proxy.IsClientSocketConnected {Proxy.IsClientSocketConnected}");
                 Assert.That(Proxy.FurcadiaClientIsRunning,
                             Is.EqualTo(false),
                             $"Proxy.FurcadiaClientIsRunning {Proxy.FurcadiaClientIsRunning}");
             });
         }
     };
     Proxy.Disconnect();
     Proxy.ServerStatusChanged -= (sender, e) =>
     {
         if (e.ConnectPhase == ConnectionPhase.Disconnected)
         {
             Assert.Multiple(() =>
             {
                 Assert.That(Proxy.ServerStatus,
                             Is.EqualTo(ConnectionPhase.Disconnected),
                             $"Proxy.ServerStatus {Proxy.ServerStatus}");
                 Assert.That(Proxy.IsServerSocketConnected,
                             Is.EqualTo(false),
                             $"Proxy.IsServerSocketConnected {Proxy.IsServerSocketConnected}");
                 Assert.That(Proxy.ClientStatus,
                             Is.EqualTo(ConnectionPhase.Disconnected),
                             $"Proxy.ClientStatus {Proxy.ClientStatus}");
                 Assert.That(Proxy.IsClientSocketConnected,
                             Is.EqualTo(false),
                             $"Proxy.IsClientSocketConnected {Proxy.IsClientSocketConnected}");
                 Assert.That(Proxy.FurcadiaClientIsRunning,
                             Is.EqualTo(false),
                             $"Proxy.FurcadiaClientIsRunning {Proxy.FurcadiaClientIsRunning}");
             });
         }
     };
 }