public void getArgumentsTest() { String data = "<PACKAGE>" + " <TYPE>LOGIN_CONFIRM</TYPE>" + " <arg1>example</arg1>" + " </PACKAGE>"; Package p = new Communication_Package(Encoding.ASCII.GetBytes(data)); List <String> arguments = p.getArguments(); List <String> expectedResult = new List <String>() { "LOGIN_CONFIRM", "example" }; CollectionAssert.AreEqual(arguments, expectedResult); }
private void BMB_Load(object sender, EventArgs e) { this.input = new Input(); this.cornerPoint = new PointF(0, 0); this.buttonReady.Visible = false; // Add image to refresh button String currPath = System.IO.Directory.GetCurrentDirectory(); currPath = Directory.GetParent(currPath).Parent.Parent.FullName; //this.refreshLobbyListButton.Image= Image.FromFile(currPath+"\\refresh_icon.png"); //this.refreshLobbyListButton.ImageAlign = ContentAlignment.MiddleCenter; //this.window = CreateGraphics(); this.addLobbyButton.TextAlign = ContentAlignment.MiddleCenter; //hide add lobby panel this.addLobbyPanel.Visible = false; this.label2.Visible = false; populateGameList(); this.availableGamesBox.SelectedIndex = 0; this.connector = new TCP_Connector(); this.package = new Package(); this.cpackage = new Communication_Package(); this.pingPackage = new Communication_Package(); pingPackage.SetTypePING(); this.gamePackages = new Queue(); this.choosenGame = 0; this.mainLoopThread = new Thread(MainLoop); this.mainLoopThread.IsBackground = true; this.mainLoopThread.Start(); audio = new SoundPlayer(BMB.Properties.Resources.gnome); //TEST sww = Stopwatch.StartNew(); this.updateFormDelegate = new update(updateForm); }