示例#1
0
 public static ModuleInstaller GetModuleInstaller(string discoveryPath, string probingPath, string authToken, IEnumerable <string> manifestUrls)
 {
     if (_moduleInstaller == null)
     {
         var fileManager           = new TransactionFileManager();
         var fileSystem            = new System.IO.Abstractions.FileSystem();
         var zipFileWrapper        = new ZipFileWrapper(fileSystem, fileManager);
         var localCatalogOptions   = LocalModuleCatalog.GetOptions(discoveryPath, probingPath);
         var extCatalogOptions     = ExtModuleCatalog.GetOptions(authToken, manifestUrls);
         var localModuleCatalog    = LocalModuleCatalog.GetCatalog(localCatalogOptions);
         var externalModuleCatalog = ExtModuleCatalog.GetCatalog(extCatalogOptions, localModuleCatalog);
         var modulesClient         = new ExternalModulesClient(extCatalogOptions);
         _moduleInstaller = new ModuleInstaller(externalModuleCatalog, modulesClient, fileManager, localCatalogOptions, fileSystem, zipFileWrapper);
     }
     return(_moduleInstaller);
 }
示例#2
0
        public IEnumerable <Transaction> GetTransactions(string filePath)
        {
            var transactionDtos = TransactionFileManager.ReadTransactionDtos(filePath);
            var transactions    = new List <Transaction>();

            foreach (var transactionDto in transactionDtos)
            {
                Transaction transaction;

                if (transactionDto is IgnoredTransactionDto)
                {
                    var textLine = (transactionDto as IgnoredTransactionDto).TextLine;
                    transaction = new IgnoredTransaction(textLine);
                }
                else
                {
                    transaction = Mapper.Map <Transaction>(transactionDto);
                }

                transactions.Add(transaction);
            }

            return(transactions);
        }
示例#3
0
 public FileManagerIntegrationTests()
 {
     _fileManager = new TransactionFileManager();
 }