public void TestMethod3() { HangManGame game = new HangManGame(); Assert.IsTrue(game.CurrentWord.Equals("sadism")); Assert.IsTrue(game.CurrentWordShown.Equals("______")); Assert.IsTrue(game.GuessLetter("S")); Assert.IsTrue(game.CurrentWordShown.Equals("s___s_")); Assert.IsTrue(game.GuessLetter("d")); Assert.IsTrue(game.CurrentWordShown.Equals("s_d_s_")); Assert.IsTrue(game.GuessLetter("A")); Assert.IsTrue(game.CurrentWordShown.Equals("sad_s_")); Assert.IsTrue(game.CurrentWordShown.ToUpper().Equals("SAD_S_")); Assert.IsTrue(game.GuessLetter("m")); Assert.IsTrue(game.CurrentWordShown.Equals("sad_sm")); Assert.IsTrue(game.GuessLetter("i")); Assert.IsTrue(game.CurrentWordShown.Equals("sadism")); game.NextWord(); Assert.IsTrue(game.CurrentWord.Equals("masochism")); Assert.IsTrue(game.CurrentWordShown.Equals("_________")); }
public void TestMethod1() { HangManGame game = new HangManGame(); Assert.IsTrue(game.CurrentWord.Equals("sadism")); Assert.IsTrue(game.GuessLetter("A")); Assert.IsFalse(game.GuessLetter("Z")); }
public void TestMethod2() { HangManGame game = new HangManGame(); Assert.IsTrue(game.CurrentWord.Equals("sadism")); game.NextWord(); Assert.IsTrue(game.CurrentWord.Equals("masochism")); Assert.IsTrue(game.GuessLetter("S")); Assert.IsFalse(game.GuessLetter("j")); }
public async Task HangmanAsync() { if (RegisteredList.ContainsKey(Context.Message.Author.Id) == false) { RegisteredList.Add(Context.Message.Author.Id, new RegisteredUserClass() { DotaID = 0, DiscordID = Context.Message.Author.Id, Name = Context.Message.Author.Username }); try { using (UserContext cont = new UserContext()) { cont.Users.Add(new RegisteredUserClass() { DotaID = 0, DiscordID = Context.Message.Author.Id, Name = Context.Message.Author.Username }); await cont.SaveChangesAsync(); } } catch (Exception ex) { } } HangManGame.NewGame(Context.Message); }
static void Main() { HangManGame.Awake(); }