Exemple #1
0
        public void GivenRun_WhenUntilIsNegative_ThenThrows_Test()
        {
            var result = new SimulationRunner <SimulationEnvironment>(new SimulationEnvironment());
            var until  = TimeSpan.FromSeconds(-1);

            Assert.Throws <ArgumentOutOfRangeException>(() => result.Run(until));
        }
Exemple #2
0
        public void GivenCtor_WhenSimulationEnvironment_Then()
        {
            var expected = new SimulationEnvironment();

            var result = new SimulationRunner <SimulationEnvironment>(expected);

            Assert.Equal(expected, result.Environment);
        }
Exemple #3
0
        public void GivenActivate_WhenAtIsNegative_ThenThrows_Test()
        {
            var result  = new SimulationRunner <SimulationEnvironment>(new SimulationEnvironment());
            var at      = TimeSpan.FromSeconds(-1);
            var process = new Mock <Process>().Object;

            Assert.Throws <ArgumentOutOfRangeException>(() => result.Activate(at, process));
        }
Exemple #4
0
        public void GivenActivate_WhenProcessIsNull_ThenThrows_Test()
        {
            var result = new SimulationRunner <SimulationEnvironment>(new SimulationEnvironment());

            Assert.Throws <ArgumentNullException>(() => result.Activate(TimeSpan.Zero, null));
        }
Exemple #5
0
 public EventVisitor(SimulationRunner <TSimulationEnvironment> runner)
 {
     _runner = runner;
 }