Exemple #1
0
        public void LogInTimeout()
        {
            TestClient s0 = new TestClient();

            s0.ConnectNoLogin(OtherUser, OtherPass, new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
            Task <string> reply = s0.GetServerMessage();

            reply.Wait();
            Assert.AreEqual("Failed to login due to timeout", reply.Result);
            Assert.AreEqual(s0.net.GetConnectionStatusString(), "Disconnected");
            s0.LogOut();
        }
Exemple #2
0
        public void AdjustExpenditureTestNotLoggedIn()
        {
            TestClient s0 = new TestClient();

            s0.ConnectNoLogin(OtherUser, OtherPass);
            while (!s0.net.GetConnectionStatusString().Equals("Connected"))
            {
                Thread.Sleep(0);
            }
            Console.WriteLine("TEST: Sending adjust expenditure data");
            this.AdjustExpenditureTest(s0, OwnedFief.id, 50, 50, 50, 50, 50);
            s0.LogOut();
        }
Exemple #3
0
        public void LogOutBeforeLogIn()
        {
            TestClient s0 = new TestClient();

            s0.ConnectNoLogin(OtherUser, OtherPass, new byte[] { 1, 2, 3, 4, 5, 6 });
            while (s0.net.GetConnectionStatus() != NetConnectionStatus.Connected || !Server.ContainsConnection(OtherUser))
            {
                Thread.Sleep(0);
            }
            s0.LogOut();
            Console.WriteLine("Connection status: " + s0.net.GetConnectionStatus().ToString() + " Server contains connection? " + Server.ContainsConnection(OtherUser));
            while ((s0.net.GetConnectionStatus() != NetConnectionStatus.Disconnected) || (Server.ContainsConnection(OtherUser)))
            {
                Thread.Sleep(0);
            }
            Console.WriteLine("Connection status: " + s0.net.GetConnectionStatus().ToString() + " Server contains connection? " + Server.ContainsConnection(OtherUser));
            Assert.IsFalse(Server.ContainsConnection(OtherUser));
        }