Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string[] values = new[] { "january", "february", "march", "april" };

            IStringSorter fs = new ReversedStringSorter();
            fs = new Bag6.Sorting.ConsoleLoggingDecorator(fs);

            var result = fs.Sort(values).ToList();

            Console.WriteLine();
            Console.WriteLine("Press any key to exit");

            Console.ReadLine();





            //IFibonacciService fs = new FibonacciService();
            //fs = new ConsoleLoggingDecorator(fs);

            //var result = fs.Compute(0, 1250).ToList();

            //Console.WriteLine();
            //Console.WriteLine("Press any key to exit");

            //Console.ReadLine();
        }
Ejemplo n.º 2
0
        //[Test]
        public void Sort_Always_ReturnsExpectedResults()
        {
            var sorter = new ReversedStringSorter();

            var result = sorter.Sort(new[] { "abc", "bcd", "dcb", "cba" }).ToArray();

            Assert.AreEqual(
                new[] { "cba", "dcb", "abc", "bcd" },
                result);
        }