public void RequestAddProvider_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestProviderPacket("ADD_PROVIDER")); Assert.IsNotNull(packet); }
public void RequestRequestCustomMember_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateReportDateRangePacket("CUSTOM_MEMBER_REPORT")); Assert.IsNotNull(packet); }
public void RequestAddServiceCode_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateServiceCodePacket("ADD_SERVICE_CODE")); Assert.IsNotNull(packet); }
public void RequestMemberStatus_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestRequestMemberPacket("MEMBER_STATUS")); Assert.IsNotNull(packet); }
public void RequestAddInvoice_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestInvoicePacket("ADD_INVOICE")); Assert.IsNotNull(packet); }
public void RequestRequestCustomProvider_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateReportDateRangePacket("CUSTOM_PROVIDER_REPORT")); //Assert.IsNotNull(packet); Assert.AreNotEqual(packet, null); }
public void TestGetMD5Hash() { string str = "abcdefg"; string md5 = "7ac66c0f148de9519b8bd264312c4d64"; ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); PrivateObject obj = new PrivateObject(server); string retVal = obj.Invoke("GetMD5Hash", str).ToString(); Assert.AreEqual(retVal, md5); return; }
/// <summary> /// Initialize all data members. /// </summary> public OperatorTerminal(Boolean isFake = false) { this.isFake = isFake; // Set up the default window size. columnSize = (int)((float)Console.LargestWindowWidth / 2f); rowSize = (int)((float)Console.LargestWindowHeight / 1.4f); if (!isFake) { Console.SetWindowSize(columnSize + 1, rowSize + 2); } // Create the text ui instance. tui = new TextUI(rowSize, columnSize, isFake); // Default state is login. currentState = TerminalState.LOGIN; // Setup the array of updateDelegates. updateDelegates = new UpdateDelegate[(int)TerminalState.COUNT]; // Set each updateDelegate. updateDelegates[(int)TerminalState.LOGIN] = LoginUpdate; updateDelegates[(int)TerminalState.MENU] = MenuUpdate; // Initially, no user logged in. sessionID = ""; userID = ""; // Generate a server instance. server = new ChocAnServer.ChocAnServer(); // Generate a packet factory instance. packetFactory = new PacketFactory(); }
public void RequestAddProvider_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestMemberPacket("ADD_PROVIDER"))); }
public void RequestProviderDirectory_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction( new BasePacket("VIEW_PROVIDER_DIRECTORY", "1234")); }
public void UpdateServiceCode_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestInvoicePacket("UPDATE_SERVICE_CODE"))); }
public void ProcessAction_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentNullException>(() => server.ProcessAction(null)); return; }
public void UpdateProvider_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestInvoicePacket("UPDATE_PROVIDER"))); }
public void UpdateServiceCode_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateServiceCodePacket("UPDATE_SERVICE_CODE")); }
public void UpdateMember_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestMemberPacket("UPDATE_MEMBER")); }
public void UpdateProvider_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestProviderPacket("UPDATE_PROVIDER")); }
public void RequestRemoveMember_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestInvoicePacket("REMOVE_MEMBER"))); }
public void RequestRemoveProvider_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestProviderPacket("REMOVE_PROVIDER")); }
public void RequestRemoveMember_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction(GenerateTestMemberPacket("REMOVE_MEMBER")); }
public void RequestAddServiceCode_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestMemberPacket("ADD_SERVICE_CODE"))); }
public void RequestMemberStatus_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestInvoicePacket("MEMBER_STATUS"))); }
public void RequestRequestCustomMember_Invalid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); Assert.ThrowsException <ArgumentException>(() => server.ProcessAction(GenerateTestMemberPacket("CUSTOM_MEMBER_REPORT"))); }
public void RequestMainAccountingProcedure_Valid() { ChocAnServer.ChocAnServer server = new ChocAnServer.ChocAnServer(); ResponsePacket packet = server.ProcessAction( new BasePacket("MAIN_ACCOUNTING_PROCEDURE", "1234")); }