Beispiel #1
0
        public void Should_Apply_Filter_When_Args_Exist()
        {
            filter.Setup(f => f.Transform(It.IsAny<List<string>>(),
                                          It.IsAny<List<string>>())).Verifiable();

            fa = new FilterApplyer(new List<Filter>(){filter.Object});

            var input = new List<string> { "one", "two" };
            var args = new Dictionary<string, string> { { "u", "true" } };

            fa.Apply(input, args);

            filter.Verify();
        }
Beispiel #2
0
        private static List<string> extract(string[] args)
        {
            List<string> result = null;
            WordDocument document = null;
            var parser = new ArgsParser();

            try
            {
                document = new WordDocument();
                var filters = new FilterApplyer(new List<Filter>()
                              { new UnixFilter(),
                                new NoCarriageReturnFilter()
                              });

                var dumper = new WordDumper(document, filters);
                result = dumper.Dump(parser.Parse(args));
            }
            catch
            {
                if (document != null)
                    document.Finally();
            }
            return result;
        }
Beispiel #3
0
 public void SetUp()
 {
     filter = new Mock<Filter>();
     fa = new FilterApplyer(new List<Filter>() { filter.Object});
 }