/// <summary> /// Checks the word spelling. /// </summary> private void CheckWordSpelling() { var slc = new SpellingListClass(); var word = this.txtSpellWord.Text.Trim(); var sb = new StringBuilder(); if (slc.CheckWordSpelling(word)) { this.correct++; sb.Append("Your spelling of the word "); sb.Append(word); sb.Append(" is correct!"); } else { this.wrong++; sb.Append("Your spelling of the word "); sb.Append(word); sb.Append(" is wrong!"); this.misspelled.Add(word); } this.ShowWordsScore(); this.SaySpellingWord(sb.ToString()); }
public void CheckWordSpelling_TryAddingTwoWords() { // Arrange const string Word = "from me"; // Act var retVal = SpellingListClass.CheckWordSpelling(Word); // Assert Assert.IsFalse(retVal, "Should pass the words are not legit word for list."); }
public void CheckWordSpelling_InValidWordSpelling() { // Arrange const string Word = "finnd"; // Act var retVal = SpellingListClass.CheckWordSpelling(Word); // Assert Assert.IsFalse(retVal, "Should pass the words are not equal Misspelled."); }
public void CheckWordSpelling_ValidWordSpelling() { // Arrange const string Word = "find"; // Act var retVal = SpellingListClass.CheckWordSpelling(Word); // Assert Assert.IsTrue(retVal, "Word is spelled correctly."); }
/// <summary> /// Check the spelling word user has entered. /// </summary> /// <param name="word">The word to be checked for spelling.</param> /// <returns>True if word is correct else false.</returns> /// <created>art2m,5/12/2019</created> /// <changed>art2m,5/12/2019</changed> private bool CheckWordSpelling(string word) { if (SpellingListClass.CheckWordSpelling(word)) { return(true); } this.AddSuggestions(); return(false); }
/// <summary> /// Check the spelling word user has entered. /// </summary> /// <param name="word">The word to be checked for spelling.</param> /// <returns>True if word is correct else false.</returns> /// <created>art2m,5/12/2019</created> /// <changed>art2m,5/12/2019</changed> private bool CheckWordSpelling(string word) { var msw = new MisspelledWordsCollection(); if (SpellingListClass.CheckWordSpelling(word)) { return(true); } this.AddSuggestions(); return(false); }
/// <summary> /// Check the spelling word user has entered. /// </summary> /// <param name="word">The word to be checked for spelling.</param> /// <returns>True if word is correct else false.</returns> /// <created>art2m,5/12/2019</created> /// <changed>art2m,5/12/2019</changed> private bool CheckWordSpelling(string word) { var spwc = new SpellingWordsCollection(); if (SpellingListClass.CheckWordSpelling(word)) { this.lstWords.Items.Add(word); spwc.FillCollection(this.lstWords.Items.OfType <string>().ToList()); return(true); } this.AddSuggestions(); return(false); }
/// <summary> /// Check the spelling word user has entered. /// </summary> /// <param name="word">The word to be checked for spelling.</param> /// <returns>True if word is correct else false.</returns> /// <created>art2m,5/12/2019</created> /// <changed>art2m,5/12/2019</changed> private bool CheckWordSpelling(string word) { MyMessagesClass.NameOfMethod = MethodBase.GetCurrentMethod().Name; if (SpellingListClass.CheckWordSpelling(word)) { this.lstWords.Items.Add(word); this.words = this.lstWords.Items.OfType <string>().ToList(); //SpellingWords.FillCollection(lstWords.Items.OfType<string>().ToList()); return(true); } this.AddSuggestions(); return(false); }
/// <summary> /// Check the spelling word user has entered. /// </summary> /// <param name="word">The word to be checked for spelling.</param> /// <returns>True if word is correct else false.</returns> /// <created>art2m,5/12/2019</created> /// <changed>art2m,5/12/2019</changed> private bool CheckWordSpelling(string word) { var msw = new MisspelledWordsCollection(); if (SpellingListClass.CheckWordSpelling(word)) { return(true); } msw.AddItem(word); var msg = string.Concat("This word is not spelled correctly: ", word); const string Caption = "Spelling Incorrect."; MessageBox.Show(msg, Caption, MessageBoxButtons.OK, MessageBoxIcon.Error); this.AddSuggestions(); return(false); }