Esempio n. 1
0
        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("_________"));
        }
Esempio n. 2
0
        public void TestMethod1()
        {
            HangManGame game = new HangManGame();

            Assert.IsTrue(game.CurrentWord.Equals("sadism"));

            Assert.IsTrue(game.GuessLetter("A"));
            Assert.IsFalse(game.GuessLetter("Z"));
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 static void Main()
 {
     HangManGame.Awake();
 }