예제 #1
0
        public void Auditor()
        {
            // Setup
            ReplayMachine replayMachine           = CreateMachine();
            Mock <MachineAuditorDelegate> auditor = new Mock <MachineAuditorDelegate>();

            replayMachine.Auditors += auditor.Object;

            // Act
            replayMachine.Start();
            Thread.Sleep(10);
            replayMachine.Stop();

            // Verify
            auditor.Verify(a => a(It.Is <CoreAction>(coreAction => coreAction != null && coreAction.Type == CoreRequest.Types.RunUntil)), Times.AtLeastOnce());
        }
예제 #2
0
        public void StartAndStop()
        {
            // Setup
            ReplayMachine replayMachine = CreateMachine();
            RunningState  runningState1 = replayMachine.RunningState;

            // Act
            replayMachine.Start();
            RunningState runningState2 = replayMachine.RunningState;

            replayMachine.Stop();
            RunningState runningState3 = replayMachine.RunningState;

            // Verify
            Assert.AreEqual(RunningState.Paused, runningState1);
            Assert.AreEqual(RunningState.Running, runningState2);
            Assert.AreEqual(RunningState.Paused, runningState3);
        }