private void shot_btn_Click(object sender, EventArgs e) { // below code helps to show the picbox Shoot_picbox.Visible = true; //below code is for uploading the image Image img = Image.FromFile(@"C:\Users\hp\source\repos\Rouelette\Rouelette\resource\shots.gif"); Shoot_picbox.Image = img; Play ShotObj = new Play(); int score1 = ShotObj.Shotbullet(loadvalue, Spinvalue); if (score1 != 0 && Count1 < 2) { if (score1 == 10) { MessageBox.Show("you won and your score is 10"); shot_btn.Enabled = false; } else if (score1 == 5) { MessageBox.Show("you won and your score is 5"); shot_btn.Enabled = false; } } else { Count1++; Spinvalue = Spin_chamber(Spinvalue); } if (Count1 == 2 && score1 == 0) { MessageBox.Show("you loss and your score is 0"); shot_btn.Enabled = false; } }
public void Shot_Positive() { Play Shot_pos = new Play(); Assert.AreEqual(10, Shot_pos.Shotbullet(1, 1)); }