public void TestMethod_RemoveDuplicates()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(2);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "ABbAcCc");
        }
        public void TestMethod_Remove4AndUnderscoreGivingEmptyString()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(5);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "null or empty");
        }
        public void TestMethod_ReplaceDollarSign()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(3);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "Show me the £");
        }
        public void TestMethod_EmptyStringSupplied()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(0);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "null or empty");
        }
        public void TestMethod_MoreThan15Chars()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(1);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "This is a strin");
        }
        public void TestMethod_EmptyCollectionPassedIn()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            List <string> idata = new List <string>();
            var           odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata.Count, 0);
        }
        public void TestMethod_OpenForDebateShouldThisBeOnePoundSignOrFour()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(9);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "£");
        }
        public void TestMethod_SuppliedLDCString()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(6);
            var odata = stringProcessor.ReformatCollection(idata);

            // "AAAc91%cWwWkLq$1ci3_848v3d__K"
            Assert.AreEqual(odata[0], "Ac91%cWwWkLq£1c");
        }
        public void TestMethod_Remove4AndUnderscore()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(4);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreNotEqual(odata[0], "Hello World");
            // the double "ll" got caught! :-)
            Assert.AreEqual(odata[0], "Helo World");
        }
        public void TestMethod_OtherStrategy()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyOther());

            List <string> idata = new List <string>()
            {
                "123456789"
            };
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(odata[0], "987654321");
        }
        public void TestMethod_HandleACollection()
        {
            StringProcessor stringProcessor = new StringProcessor(new ReformatStrategyLDC());

            var idata = MockData(6, 7, 8);
            var odata = stringProcessor.ReformatCollection(idata);

            Assert.AreEqual(idata.Count, odata.Count);
            Assert.AreEqual(odata[0], "Ac91%cWwWkLq£1c");
            Assert.AreEqual(odata[1], "The dog and the");
            Assert.AreEqual(odata[2], "Aple£0");
        }