Esempio n. 1
0
        public void GetAllSince_ShouldReturnSomething()
        {
            // Arrange
            var dal  = new ArticleTrendingEventsDal(Config, TrendingDatabase.Reporting);
            var from = DateTime.UtcNow.AddDays(-5);

            // Act
            var documents = dal.GetAllSince(from);

            // Assert
            documents.Should().NotBeNullOrEmpty("there should be something in the source copy");
        }
        internal Transformer Extract(DateTime since)
        {
            Console.WriteLine($"Extracting events since {since:yyyy-MM-dd HH:mm:ss}...");

            var documents = _dal.GetAllSince(since);
            var events    = documents.Select(d => new TrendingEvent(d)).ToList();

            Console.WriteLine($"{events.Count} events found.");

            var transformer = new Transformer(_shortTrendStartTime);

            transformer.Load(events);
            Console.WriteLine("Extracting events DONE.");

            return(transformer);
        }