Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if (args == null || args.Length < 2)
            {
                Console.WriteLine("Not enough parameters.");
                Console.WriteLine("Press <ENTER> to close application.");
                Console.WriteLine();
                Console.ReadLine();
                return;
            }

            IIocImpl ioc = new IocImpl();

            string startDirPath   = args[0];
            string actionName     = args[1];
            string outputFileName = ValidateOutputFilePath(args, DefaultFileName);

            RegisterFilePathRetreiver(ioc, actionName);

            var filePathRetreiver = ioc.Resolve <IFilePathRetreiver>();

            try
            {
                MainAsync(startDirPath, filePathRetreiver, outputFileName).Wait();
                Console.WriteLine("All files found. Files number: " + _resultStringlist?.Count);
                Console.Read();
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
            }
        }
        public void RegisterFilePathRetreiverCppUnitTest()
        {
            var iocImpl = new IocImpl();

            Program.RegisterFilePathRetreiver(iocImpl, "cpp");
            var pathHandler = iocImpl.Resolve <IPathHandler>();

            Assert.IsTrue(pathHandler is ExtentionFilterPathHandler);
        }
        public void RegisterFilePathRetreiverReversed2UnitTest()
        {
            var iocImpl = new IocImpl();

            Program.RegisterFilePathRetreiver(iocImpl, "reversed2");
            var pathHandler = iocImpl.Resolve <IPathHandler>();

            Assert.IsTrue(pathHandler is Reversed2FilePathHandler);
        }
        public void RegisterFilePathRetreiverAllUnitTest()
        {
            var iocImpl = new IocImpl();

            Program.RegisterFilePathRetreiver(iocImpl, "all");
            var pathHandler = iocImpl.Resolve <IPathHandler>();

            Assert.IsTrue(pathHandler is AllFilePathHandler);
        }