public virtual void TestScheduleNextBlockReport()
 {
     foreach (long now in GetTimestamps())
     {
         BPServiceActor.Scheduler scheduler = MakeMockScheduler(now);
         NUnit.Framework.Assert.IsTrue(scheduler.resetBlockReportTime);
         scheduler.ScheduleNextBlockReport();
         NUnit.Framework.Assert.IsTrue(scheduler.nextBlockReportTime - (now + BlockReportIntervalMs
                                                                        ) < 0);
     }
 }
 public virtual void TestScheduleNextBlockReport2()
 {
     foreach (long now in GetTimestamps())
     {
         BPServiceActor.Scheduler scheduler = MakeMockScheduler(now);
         scheduler.resetBlockReportTime = false;
         scheduler.ScheduleNextBlockReport();
         Assert.AssertThat(scheduler.nextBlockReportTime, IS.Is(now + BlockReportIntervalMs
                                                                ));
     }
 }
 public virtual void TestScheduleNextBlockReport3()
 {
     foreach (long now in GetTimestamps())
     {
         BPServiceActor.Scheduler scheduler = MakeMockScheduler(now);
         scheduler.resetBlockReportTime = false;
         // Make it look like the block report was scheduled to be sent between 1-3
         // intervals ago but sent just now.
         long blockReportDelay = BlockReportIntervalMs + random.Next(2 * (int)BlockReportIntervalMs
                                                                     );
         long origBlockReportTime = now - blockReportDelay;
         scheduler.nextBlockReportTime = origBlockReportTime;
         scheduler.ScheduleNextBlockReport();
         NUnit.Framework.Assert.IsTrue(scheduler.nextBlockReportTime - now < BlockReportIntervalMs
                                       );
         NUnit.Framework.Assert.IsTrue(((scheduler.nextBlockReportTime - origBlockReportTime
                                         ) % BlockReportIntervalMs) == 0);
     }
 }