private void task3(object sender, RoutedEventArgs e) { // work with words //todo защита от неверного ввода textBox_unsver.Text = TextLetters.getCountVowels(textBox_user.Text) + "%"; textBox_task.Text = "3.Create a Set of the vowels.Count and " + "display the number of vowels in each input word, and also " + "display the total number of vowels in the input text, percent of each of them."; }
public void getCountVowelsText_Test() { float expected = (4 * 100) / 11; StringBuilder sb = new StringBuilder(); sb.Append("uiggddbifsa"); float actual = TextLetters.getCountVowels(sb); Assert.AreEqual(expected, actual); }