Пример #1
0
        public void Setup()
        {
            _downloaderLogic = new DownloaderLogic(new Mock <ILogger <DownloaderLogic> >().Object);
            _commandRunner   = new CommandRunner();

            IConfiguration Configuration = new ConfigurationBuilder()
                                           .SetBasePath(Directory.GetCurrentDirectory())
#if DEBUG
                                           .AddJsonFile($"appsettings.Development.json", false)
#else
                                           .AddJsonFile("appsettings.json", false)
#endif
                                           .Build();

            _artifactoryUrl    = Configuration.GetValue <string>("ArtifactoryUrl");
            _artifactoryApiKey = Configuration.GetValue <string>("ArtifactoryApiKey");
            _downloadFolder    = Configuration.GetValue <string>("DownloadFolder");

            if (Directory.Exists(_downloadFolder))
            {
                Directory.Delete(_downloadFolder, true);
            }

            Directory.CreateDirectory(_downloadFolder);
        }
Пример #2
0
        static void Main(string[] args)
        {
            try
            {
                var settings = GetSettings();

                var blobStorageService   = new BlobStorageService(settings.StorageAccountCs, settings.ContainerName);
                var tableStorageService  = new TableStorageService(settings.StorageAccountCs, settings.TableName);
                var syncStatusRepository = new SyncStatusRepository();

                var downloadLogic = new DownloaderLogic(blobStorageService, tableStorageService, syncStatusRepository);
                var t             = downloadLogic.RunAsync();
                t.Wait();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine("Job done!");
            Console.ReadLine();
        }
Пример #3
0
 public void Setup()
 {
     _downloaderLogic = new DownloaderLogic(new Mock <ILogger <DownloaderLogic> >().Object);
 }