Example #1
0
 private void ExecuteStartAction(StartRecordingAction action)
 {
     this.platform.StartRecording(
                 action.RecordingId,
                 action.ChannelId,
                 action.StartTime,
                 action.StopTime);
 }
        public void ARecordingCanBeCreated()
        {
            var action = new StartRecordingAction { 
                RecordingId = 5, 
                ChannelId = 32, 
                StartTime = DateTime.Now, 
                StopTime = DateTime.Now.AddHours(1)
            };
            this.actionExecutor.ExecuteActions(new List<RecordingAction> { action });

            this.platformMock.Verify(p => p.StartRecording(
                action.RecordingId,
                action.ChannelId,
                action.StartTime,
                action.StopTime));
        }
Example #3
0
        static void RunOcp()
        {
            var actionExecutor = new ActionExecutor();
            
            Console.WriteLine("Executing start recording action");
            var startRecordingAction = new StartRecordingAction { RecordingId = 1, ChannelId = 42, StartTime = DateTime.Now, StopTime = DateTime.Now.AddHours(2) };
            actionExecutor.ExecuteActions(new List<RecordingAction> { startRecordingAction });

            Console.WriteLine("Executing stop recording action");
            var stopRecordingAction = new StopRecordingAction { RecordingId = 1, StopTime = DateTime.Now.AddHours(1) };
            actionExecutor.ExecuteActions(new List<RecordingAction> { stopRecordingAction });

            Console.WriteLine("Executing list of actions");
            actionExecutor.ExecuteActions(new List<RecordingAction> { 
                new StopRecordingAction { RecordingId = 9287, StopTime = DateTime.Now },
                new StartRecordingAction { RecordingId = 322, ChannelId = 11, StartTime = DateTime.Now.AddMinutes(15), StopTime = DateTime.Now.AddHours(1) },
                new StartRecordingAction { RecordingId = 23, ChannelId = 4, StartTime = DateTime.Now, StopTime = DateTime.Now.AddMinutes(30) }
            });
        }
        public void ARecordingCanBeCreated_AndDeleted()
        {
            var startAction = new StartRecordingAction
            {
                RecordingId = 1,
                ChannelId = 32,
                StartTime = DateTime.Now,
                StopTime = DateTime.Now.AddHours(1)
            };
            var deleteAction = new DeleteRecordingAction
            {
                RecordingId = 1
            };
            this.actionExecutor.ExecuteActions(new List<RecordingAction> { startAction, deleteAction });

            this.platformMock.Verify(p => p.StartRecording(
                startAction.RecordingId,
                startAction.ChannelId,
                startAction.StartTime,
                startAction.StopTime));
            this.platformMock.Verify(p => p.DeleteRecording(deleteAction.RecordingId));
        }
        public void ARecordingCanBeCreated_AndStoppedEarlier()
        {
            var startAction = new StartRecordingAction
            {
                RecordingId = 75,
                ChannelId = 32,
                StartTime = DateTime.Now,
                StopTime = DateTime.Now.AddHours(1)
            };
            var stopAction = new StopRecordingAction
            {
                RecordingId = 75,
                StopTime = DateTime.Now.AddMinutes(30)
            };
            this.actionExecutor.ExecuteActions(new List<RecordingAction> { startAction, stopAction });

            this.platformMock.Verify(p => p.StartRecording(
                startAction.RecordingId,
                startAction.ChannelId,
                startAction.StartTime,
                startAction.StopTime));
            this.platformMock.Verify(p => p.StopRecording(stopAction.RecordingId, stopAction.StopTime));
        }