Exemplo n.º 1
0
        public void OperatorTerminal_CreateInstance_InstanceIsNotNull()
        {
            OperatorTerminal.EnableMock();
            OperatorTerminal operatorTerminal = new OperatorTerminal(true);

            Assert.IsNotNull(operatorTerminal);
            OperatorTerminal.DisableMock();
            return;
        }
Exemplo n.º 2
0
    static void Main()
    {
        // Mmmmm. This new background color is nice.
        Console.BackgroundColor = ConsoleColor.DarkMagenta;
        Console.ForegroundColor = ConsoleColor.Green;
        bool running = true;

        while (running)
        {
            Console.Clear();
            Console.WriteLine("Select the terminal you would like to use:" +
                              "\n1. Provider Terminal" +
                              "\n2. Manager Terminal" +
                              "\n0. Quit");

            string input = Console.ReadLine();

            OperatorTerminal terminal = null;

            if (input.Equals("1"))
            {
                terminal = new ProviderTerminal();
            }
            else if (input.Equals("2"))
            {
                terminal = new ManagerTerminal();
            }
            else if (input.Equals("0"))
            {
                running = false;
            }

            // Loop the program until the user wants to quit.E
            // Or maybe something goes wrong, like really, really wrong.
            if (terminal != null && running == true)
            {
                if (!terminal.Loop())
                {
                    terminal = null;
                }
            }
        }

        // Force a close on the database, this will hopefully make Daniel happy.
        // Here is an owl.
        //
        //         ^ ^
        //        (0,0)
        //        (  ()
        //        _| _|
        // Or maybe it's a cat?
        // Anyway, let's close it, enough screwing around.
        SQLLiteDatabaseCenter.DatabaseCenter.Singelton.Close();
        return;
    }
Exemplo n.º 3
0
        public void LoginUpdate_GoodUserAndPass_ResponseSuccess()
        {
            OperatorTerminal.EnableMock();
            OperatorTerminal.ChangeMockState(OperatorTerminal.TerminalState.LOGIN);
            OperatorTerminal.ChangeMockPacket(new LoginPacket("LOGIN", "", "123456789", "asdf", 1));

            OperatorTerminal operatorTerminal = new OperatorTerminal(true);

            operatorTerminal.Loop();

            // I set the MockPacket to a response pack when mock mode is enabled.
            ResponsePacket response = OperatorTerminal.MockPacket as ResponsePacket;


            Assert.AreEqual(response.Response(), "Login Successful");
            OperatorTerminal.DisableMock();
            return;
        }
Exemplo n.º 4
0
        public void OperatorTerminal_AccessLevel_Valid()
        {
            OperatorTerminal operatorTerminal = new OperatorTerminal(true);

            Assert.AreEqual(-1, operatorTerminal.AccessLevel());
        }
Exemplo n.º 5
0
        public void OperatorTerminal_IsLoggedIn_Valid()
        {
            OperatorTerminal operatorTerminal = new OperatorTerminal(true);

            Assert.IsFalse(operatorTerminal.IsLoggedIn());
        }