public void TestCheckAtemAndCameraSetting()
        {
            ConfigurationModel cfg = new ConfigurationModel
            {
                AtemHost = "192.168.10.145",
                UseTallyGreen = true,
                Cameras = new List<CameraConnexionModel>
                {
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.20", CameraName = "CAM 1", CameraPort = 5002
                    },
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.21", CameraName = "CAM 2", CameraPort = 5002
                    },
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.22", CameraName = "CAM 3", CameraPort = 5002
                    },
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.23", CameraName = "CAM 4", CameraPort = 5002
                    }
                }
            };

            SimpleIoc.Default.Register<IDisplayMessage, AssertDisplayMessage>();


            PTZManager manager = new PTZManager();
            manager.InitSeetings(cfg);
            MockAtemMissmatchHandler atem = new MockAtemMissmatchHandler();
            atem.Configuration = cfg;
            //Create
            List<MockCameraMissmatchHandler> cams = new List<MockCameraMissmatchHandler>(cfg.Cameras.Count);
            for (int i = 0; i < cfg.Cameras.Count; i++)
            {
                cams.Add(new MockCameraMissmatchHandler { Configuration = cfg.Cameras[i] });
                manager.AddCameraHandler(cams[i]);
            }


            //initialize Program and Preview
            manager.SetSwitcherHandler(atem);


            //startup
            manager.StartUp();

            //after startup Cam preview 0 is green, program 1 red and other off
            Assert.IsTrue(AssertDisplayMessage.ShowError,"Message box wasnot called!");

            SimpleIoc.Default.Unregister<IDisplayMessage>();
            manager.ShutDown();
            manager = null;
        }
        public void TestPTZManager()
        {
            ConfigurationModel cfg = new ConfigurationModel
            {
                AtemHost      = "192.168.10.145",
                UseTallyGreen = true,
                Cameras       = new List <CameraConnexionModel>
                {
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.20", CameraName = "CAM 1", CameraPort = 5002
                    },
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.21", CameraName = "CAM 2", CameraPort = 5002
                    },
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.22", CameraName = "CAM 3", CameraPort = 5002
                    },
                    new CameraConnexionModel
                    {
                        CameraHost = "192.168.1.23", CameraName = "CAM 4", CameraPort = 5002
                    }
                }
            };

            PTZManager manager = new PTZManager();

            manager.InitSeetings(cfg);
            MockAtemHandler atem = new MockAtemHandler();

            atem.Configuration = cfg;
            //Create
            List <MockCameraHandler> cams = new List <MockCameraHandler>(cfg.Cameras.Count);

            for (int i = 0; i < cfg.Cameras.Count; i++)
            {
                cams.Add(new MockCameraHandler {
                    Configuration = cfg.Cameras[i]
                });
                manager.AddCameraHandler(cams[i]);
            }


            //initialize Program and Preview
            manager.SetSwitcherHandler(atem);


            //startup
            manager.StartUp();

            //after startup Cam preview 0 is green, program 1 red and other off
            Assert.IsTrue(cams[0].TallyStatus == MockTallyStatus.Green, "Tally camera is not green");
            Assert.IsTrue(cams[1].TallyStatus == MockTallyStatus.Red, "Tally camera is not red");
            Assert.IsTrue(cams[2].TallyStatus == MockTallyStatus.Off, "Tally camera is not off");
            Assert.IsTrue(cams[3].TallyStatus == MockTallyStatus.Off, "Tally camera is not off");


            Assert.AreEqual(manager.CameraPreview, cams[0], "Camera Preview not the set");
            Assert.AreEqual(manager.CameraProgram, cams[1], "Camera Program not the set");


            atem.CutInput();
            Assert.IsTrue(cams[1].TallyStatus == MockTallyStatus.Green, "Tally camera is not green");
            Assert.IsTrue(cams[0].TallyStatus == MockTallyStatus.Red, "Tally camera is not red");
            Assert.IsTrue(cams[2].TallyStatus == MockTallyStatus.Off, "Tally camera is not off");
            Assert.IsTrue(cams[3].TallyStatus == MockTallyStatus.Off, "Tally camera is not off");

            atem.CutInput();
            Assert.IsTrue(cams[0].TallyStatus == MockTallyStatus.Green, "Tally camera is not green");
            Assert.IsTrue(cams[1].TallyStatus == MockTallyStatus.Red, "Tally camera is not red");
            Assert.IsTrue(cams[2].TallyStatus == MockTallyStatus.Off, "Tally camera is not off");
            Assert.IsTrue(cams[3].TallyStatus == MockTallyStatus.Off, "Tally camera is not off");

            manager.ShutDown();
            manager = null;
        }