public void TestMenuExit() { MenuForm myform = new MenuForm(); myform.Show(); Assert.IsTrue(myform.Visible, "Checks if form is visible"); myform.Close(); Assert.IsFalse(myform.Visible, "Checks if form is visible"); }
public void TestExit() { MenuForm form = new MenuForm(); form.Show(); Assert.IsTrue(form.Visible, "Test if menu is running"); form.Close(); Assert.IsFalse(form.Visible, "Checks if form is running"); }
public void TestMenuSettings() { MenuForm myform = new MenuForm(); myform.Show(); Assert.IsTrue(myform.Visible, "Checks if form is visible"); myform.c = true; myform.a = true; myform.StartGame(); Assert.IsTrue(myform.changed, "Checks if settings changed"); }
public void TestMenuBackground() { MenuForm form = new MenuForm (); form.Show (); Assert.AreNotSame (System.Drawing.Image.FromFile(@"../../Resources/snakestartscreenfinal.png"), form.BackgroundImage); }
/// <summary> /// When back to menu tool strip button is clicked /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void toolStripBackToMenu_Click(object sender, EventArgs e) { Settings.GameOver = true; this.Close(); MenuForm menu = new MenuForm(); menu.Show(); }
public void UpdateScreen(object sender, EventArgs e) { MovePlayer(); if (Settings.GameOver) { gameTimer.Stop(); MenuForm form = new MenuForm(); this.Hide(); form.Show(); } if (snake[0].X == ((pbCanvas.Width /16)/2)) { Settings.direction = Direction.Up; } if (snake[0].Y == ((pbCanvas.Height / 16) / 4)) { Settings.direction = Direction.Right; } pbCanvas.Invalidate(); }