Example #1
0
        public void ItWorksOnAVeryLongList()
        {
            var size   = 100000;
            var input  = Enumerable.Range(1, size).Select(i => $"item{i}").ToList();
            var output = ListFormatter.Format(input);

            Assert.AreEqual("100000. Item100000", output[size - 1]);
        }
Example #2
0
        [Test] public void ItWorksOnSingletonList()
        {
            var input = new List <string> {
                "coffee beans"
            };
            var output = ListFormatter.Format(input);

            Assert.AreEqual("1. Coffee beans", output[0]);
        }
Example #3
0
        public void ItWorksOnLongerList()
        {
            var input = new List <string> {
                "coffee beans", "BANANAS"
            };
            var output = ListFormatter.Format(input);

            Assert.AreEqual("1. Coffee beans", output[0]);
            Assert.AreEqual("2. Bananas", output[1]);
        }
Example #4
0
        internal static void _main()
        {
            var shoppingList = new List <string> {
                "coffee beans", "BANANAS", "Dates"
            };

            ListFormatter
            .Format(shoppingList)
            .ForEach(WriteLine);

            Read();
        }