Пример #1
0
        /// <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());
        }
Пример #2
0
        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.");
        }
Пример #3
0
        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.");
        }
Пример #4
0
        public void CheckWordSpelling_ValidWordSpelling()
        {
            // Arrange
            const string Word = "find";

            // Act
            var retVal = SpellingListClass.CheckWordSpelling(Word);

            // Assert
            Assert.IsTrue(retVal, "Word is spelled correctly.");
        }
Пример #5
0
        /// <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);
        }
Пример #6
0
        /// <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);
        }
Пример #7
0
        /// <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);
        }
Пример #8
0
        /// <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);
        }
Пример #9
0
        /// <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);
        }