Exemple #1
0
 private static void Execute(string oldEventLogPath, IMessageBus messageBus, ILogger logger)
 {
     if (Directory.Exists(oldEventLogPath))
     {
         var count = LogFileUtils.ResubmitLogs(new LogFileManager(oldEventLogPath), messageBus);
         logger.Info("Migrated {0} events from old to new event log path.", count);
         messageBus.Publish(new InfoEvent {
             Info = "wat?"
         });
         Directory.Delete(oldEventLogPath, true);
     }
 }
Exemple #2
0
        public void ResubmittedEventsDontChange()
        {
            var hashes = _sourceLogFileManager.Logs.SelectMany(l => l.ReadAll()).Select(e => e.GetHashCode()).ToList();

            Assert.AreEqual(6, hashes.Count);
            LogFileUtils.ResubmitLogs(_sourceLogFileManager, _messageBus);
            foreach (var e in _receivedEvents)
            {
                hashes.Remove(e.GetHashCode());
            }
            Assert.AreEqual(0, hashes.Count);
        }
 private static void Execute(IList <string> paths, IMessageBus messageBus, ILogger logger)
 {
     foreach (var path in paths)
     {
         if (Directory.Exists(path))
         {
             logger.Info("Starting to migrate events from an old to a new event log path.");
             var count = LogFileUtils.ResubmitLogs(new LogFileManager(path), messageBus);
             logger.Info("Migrated {0} events from an old to a new event log path.", count);
             // ReSharper disable once AssignNullToNotNullAttribute
             Directory.Delete(path, true);
         }
     }
 }
Exemple #4
0
        public void AllResubmittedEventsArrive()
        {
            var count = LogFileUtils.ResubmitLogs(_sourceLogFileManager, _messageBus);

            Assert.AreEqual(6, count);
        }