Esempio n. 1
0
        public void DownloadsDamFile()
        {
            var result = _downloader.TryDownload();

            result.ShouldNotBeNull();
            result.Length.ShouldBeGreaterThan(50000);
            result.Length.ShouldBeLessThan(100000);
        }
Esempio n. 2
0
        public void Update()
        {
            Global.Logger.Info("Downloading dam excel file.");
            var bytes = _damExcelDownloader.TryDownload();

            if (bytes == null)
            {
                Global.Logger.Info("Zero bytes downloaded.");
                return;
            }

            Global.Logger.Info("Reading Excel to dataset.");
            var dataSet = _excelReader.Read(bytes);

            Global.Logger.Info("Translating data sets to snapshots.");
            var snapshots = _dataSetToDamSnapshotTranslator.Translate(dataSet);

            Global.Logger.Info("Persisting snapshots.");
            _damSnapshotRepository.Update(snapshots);
            Global.Logger.Info("Done.");
        }