public void RealTimeOptions_ShouldOverwriteDefaultWallClock() { var opts = new SimEnvironment.RealTimeOptions(); Assert.That(opts.WallClock, Is.SameAs(SimEnvironment.RealTimeOptions.DefaultWallClock)); var newWallClock = new NtpClock(new NoOpLogger()); opts.WallClock = newWallClock; Assert.That(opts.WallClock, Is.SameAs(newWallClock)); }
public void RealTimeEnvironment_ShouldNotChangeCustomOptionsAfterCreation_WithSeed_WallClock() { const double newScalingFactor = 3.0; var newWallClock = new NtpClock(new NoOpLogger()); var env = Sim.RealTimeEnvironment(21, new SimEnvironment.RealTimeOptions { ScalingFactor = newScalingFactor, WallClock = newWallClock }); env.RealTime.WallClock = new MockClock(); }
public void RealTimeEnvironment_ShouldBeCreatedWithCustomOptions_WithSeed() { const double newScalingFactor = 3.0; var newWallClock = new NtpClock(new NoOpLogger()); var env = Sim.RealTimeEnvironment(21, new SimEnvironment.RealTimeOptions { ScalingFactor = newScalingFactor, WallClock = newWallClock }); Assert.That(env.RealTime.Enabled, Is.True); Assert.That(env.RealTime.Locked, Is.True); Assert.That(env.RealTime.ScalingFactor, Is.EqualTo(newScalingFactor)); Assert.That(env.RealTime.WallClock, Is.SameAs(newWallClock)); }