Пример #1
0
        public static void Main(string[] args)
        {
            var logger = LogManager.GetCurrentClassLogger();
            logger.Trace("Main():");
            for (var i = 0; i < args.Length; i++)
                logger.Trace(string.Format("  {0}: {1}", i, args[i]));

            var processExecuter = new ProcessExecuter();
            var messageDisplayer = new FormDisplayer();
            var fileProvider = new FileProvider();
            var fileExtPersister = new FileExtensionPersister(fileProvider);
            var fileExtLocator = new FileExtensionLocator(fileExtPersister, new BuiltInFileExtensions());
            var clp = new CommandLineParser(processExecuter, messageDisplayer, fileExtLocator);
            clp.Parse(args);
        }
 public void Locates_saved_defaulted_fileext_before_explicit_builtin()
 {
     var locator = new FileExtensionLocator(_savedFileExtensionPersisterWithDefault, _builtInFileExtensionPersister);
     var fileExt = locator.GetFileExtension(new[] { @"c:\something\file.notsaved" });
     Assert.That(fileExt, Has.Property("DiffArguments").EqualTo("default diff arguments"));
 }
 public void Locates_saved_matched_fileext_first()
 {
     var locator = new FileExtensionLocator(_savedFileExtensionPersisterWithDefault, _builtInFileExtensionPersister);
     var fileExt = locator.GetFileExtension(new[] {@"c:\something\file.saved"});
     Assert.That(fileExt, Has.Property("DiffArguments").EqualTo("saved diff arguments"));
 }
 public void Locates_builtin_matched_before_builtin_default()
 {
     var locator = new FileExtensionLocator(_savedFileExtensionPersisterWithoutDefault, _builtInFileExtensionPersister);
     var fileExt = locator.GetFileExtension(new[] { @"c:\something\file.builtin" });
     Assert.That(fileExt, Has.Property("DiffArguments").EqualTo("builtin diff arguments"));
 }