static void Main(string[] args)
        {
            const string sentance = "This is a great evening for a walk with my dog.";

            Console.WriteLine("Source sentance:");
            Console.WriteLine(sentance + Environment.NewLine);
            var factory = new StringManipulationFactory();

            var options = Enum.GetValues(typeof(SentanceOperationTypes));

            foreach (var option in options)
            {
                Console.WriteLine("Result for: {0}", Enum.GetName(typeof(SentanceOperationTypes), option));
                Console.WriteLine(factory.GetReverseSentance((SentanceOperationTypes)option).Reverse(sentance) + Environment.NewLine + Environment.NewLine);
            }

            Console.ReadLine();
        }
Example #2
0
 private void CallAllOperationsAtOnce(string sentenace)
 {
     Assert.AreEqual(_factory.GetReverseSentance(SentanceOperationTypes.ReverseUsingArrays).Reverse(sentenace), "");
     Assert.AreEqual(_factory.GetReverseSentance(SentanceOperationTypes.ReverseUsingStringLibrary).Reverse(sentenace), "");
     Assert.AreEqual(_factory.GetReverseSentance(SentanceOperationTypes.ReversecharactersInPlace).Reverse(sentenace), "");
 }
 private void CallAllOperationsAtOnce(string sentenace)
 {
     Assert.AreEqual(_factory.GetReverseSentance(SentanceOperationTypes.WordsReversalUsingRegex).Reverse(sentenace), "");
     Assert.AreEqual(_factory.GetReverseSentance(SentanceOperationTypes.WordsReversalUsingStack).Reverse(sentenace), "");
     Assert.AreEqual(_factory.GetReverseSentance(SentanceOperationTypes.WordsReversalUsingInPlace).Reverse(sentenace), "");
 }