public void OperatorTerminal_CreateInstance_InstanceIsNotNull() { OperatorTerminal.EnableMock(); OperatorTerminal operatorTerminal = new OperatorTerminal(true); Assert.IsNotNull(operatorTerminal); OperatorTerminal.DisableMock(); return; }
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; }
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; }
public void OperatorTerminal_AccessLevel_Valid() { OperatorTerminal operatorTerminal = new OperatorTerminal(true); Assert.AreEqual(-1, operatorTerminal.AccessLevel()); }
public void OperatorTerminal_IsLoggedIn_Valid() { OperatorTerminal operatorTerminal = new OperatorTerminal(true); Assert.IsFalse(operatorTerminal.IsLoggedIn()); }