pszczyg

Untitled

Jun 30th, 2017
270
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void Most_Detailed_Scenario()
  2.       {
  3.           var dateTimeProvider = new TestDateTimeProvider(new DateTime(201755235959));
  4.           var configuration = new TestConfiguration(dateTimeProvider) { MidnightRelativeStartTime = TimeSpan.FromHours(7)
  5.             PublishInterval = TimeSpan.FromHours(1) };
  6.           var thread = new ElinMonMeterCollectionThread(configuration, new List<IAmWorkflowManager>()null, dateTimeProvider);
  7.  
  8.           var timeList = new Dictionary<DateTime, Tuple<int, DateTime>>
  9.           {
  10.               {new DateTime(201755235959)new Tuple<int, DateTime>(1new DateTime(20175605959))},
  11.               {new DateTime(20175615959)new Tuple<int, DateTime>(1new DateTime(201756700))},
  12.               {new DateTime(20175634534)new Tuple<int, DateTime>(1new DateTime(201756700))},
  13.               {new DateTime(201756710,10)new Tuple<int, DateTime>(2new DateTime(20175681010))},
  14.               {new DateTime(2017561014,14)new Tuple<int, DateTime>(3new DateTime(201756111414))},
  15.               {new DateTime(201756230,0)new Tuple<int, DateTime>(4new DateTime(2017570,0,0))},
  16.               {new DateTime(20175700,0)new Tuple<int, DateTime>(4new DateTime(2017577,0,0))},
  17.           };
  18.  
  19.           foreach (var entry in timeList)
  20.           {
  21.               dateTimeProvider.Now = entry.Key;
  22.               thread.DoPeriodicCheckIfNeeded(thread.TimeForNextPeriodicCheck, _fakeFunctionality);
  23.               Assert.That(_fakeFunctionalityHitCounter, Is.EqualTo(entry.Value.Item1));
  24.               Assert.That(thread.TimeForNextPeriodicCheckIs.EqualTo(entry.Value.Item2));
  25.           }
  26.       }
RAW Paste Data