示例#1
0
        public void Hardcoded()
        {
            List <string> tStrings       = new List <string>();
            List <string> correctStrings = new List <string>();

            tStrings.Add("AA");
            correctStrings.Add("A");

            tStrings.Add("AAA");
            correctStrings.Add("A");

            tStrings.Add("AAAc91%cWwWkLq$1ci3_848v3d__K");
            correctStrings.Add("Ac91%cWwWkLq£1c");

            tStrings.Add("$$$$$");
            correctStrings.Add("£");

            // The next two strings shouldn't return anything, as the characters should be removed.
            tStrings.Add("444");
            tStrings.Add("___");

            List <String> processedStrings = processor.Process(tStrings);

            Assert.True(processedStrings.SequenceEqual(correctStrings), "Returned strings are not as expected:\r\n" + string.Join("\r\n", processedStrings));
        }
        private void OnProcessText(object sender, RoutedEventArgs e)
        {
            IStringProcessor processor = availableProcessors.SelectedItem as IStringProcessor;

            if (processor != null)
            {
                string input  = originalText.Text;
                string result = processor.Process(input);
                resultText.Text = result;
            }
        }