public void ButtonClicked(char value) { if (!playedChars.Contains(value)) { try { gamePlayBusiness.PlayLetter(value); } catch (IncorectLetterExeption) { ShowNextPic(); // lblLivesLeft.Text = (9 - gamePlayBusiness.Mistakes).ToString(); } finally { playedChars.Add(value); UpdateWord(); CheckIfLost(); CheckIfWon(); } } }
public void TestPlayLetterThrowsIncorectLetterExeption(char letter) { Assert.ThrowsException <HangManV2.Commons.IncorectLetterExeption>(() => gamePlayBusiness.PlayLetter(letter)); }