Beispiel #1
0
 public void TestInValids()
 {
     foreach (string word in invalid_words)
     {
         LanguageWord lWord = new LanguageWord(word);
         Assert.IsFalse(lWord.isValidWord());
     }
 }
Beispiel #2
0
 public void TestRandomInValidWords()
 {
     foreach (var word in random_invalid_words)
     {
         LanguageWord lWord = new LanguageWord(word);
         Assert.IsFalse(lWord.isValidWord());
     }
 }
Beispiel #3
0
 public void TestValids()
 {
     foreach (string word in valid_words)
     {
         LanguageWord lWord = new LanguageWord(word);
         Console.WriteLine("Checking word:" + word);
         Assert.IsTrue(lWord.isValidWord());
     }
 }
Beispiel #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            //Console.Write("Enter a word : ");
            //String iWord = Console.ReadLine();
            // can add input validations to remove special characters, etc etc
            string iWord;

            iWord = textBox1.Text;
            string       cword = iWord;
            LanguageWord lWord = new LanguageWord(iWord);

            if (lWord.isValidWord())
            {
                label1.Text = iWord + "  Is a valid Word";
            }
            else
            {
                label1.Text = iWord + "  Is a invalid Word";
            }
        }