예제 #1
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 Initialize()
 {
     this.platformMock = new Mock<IPlatformAPI>();
     PlatformAPI.SetPlatformAPI(this.platformMock.Object);
     this.actionExecutor = new ActionExecutor();
 }