示例#1
0
        private byte[] CreateTimeCommand(uint?rawTime = null)
        {
            uint time = rawTime ?? CurrentTime++;

            var cmd = new TimeCodeCommand();

            cmd.Second += time % 60;
            cmd.Minute  = time / 60;
            return(cmd.ToByteArray());
        }
        public void TestSetTimecode()
        {
            var expectedCmd = new TimeCodeCommand();
            var handler     = CommandGenerator.MatchCommand(expectedCmd, false, "IsDropFrame");

            AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.All, helper =>
            {
                IBMDSwitcher switcher = helper.SdkClient.SdkSwitcher;

                AtemState stateBefore = helper.Helper.BuildLibState();

                uint timeBefore = helper.Server.CurrentTime;

                helper.SendAndWaitForChange(stateBefore,
                                            () =>
                {
                    switcher.SetTimeCode((byte)expectedCmd.Hour, (byte)expectedCmd.Minute,
                                         (byte)expectedCmd.Second, (byte)expectedCmd.Frame);
                });

                // It should have sent a response, but we dont expect any comparable data
                Assert.NotEqual(timeBefore, helper.Server.CurrentTime);
            });
        }