コード例 #1
0
        public void TestSetInvalid()
        {
            AtemMockServerWrapper.Each(_output, _pool, ClearCommandHandler, DeviceTestCases.MediaPlayerClips, helper =>
            {
                ImmutableList <ICommand> previousCommands = helper.Server.GetParsedDataDump();

                int clipCount = helper.Helper.BuildLibState().MediaPool.Clips.Count;
                for (int index = 0; index < clipCount; index++)
                {
                    AtemState stateBefore = helper.Helper.BuildLibState();

                    IBMDSwitcherClip clip = GetClip(helper, (uint)index);

                    for (int i = 0; i < 5; i++)
                    {
                        MediaPoolClipDescriptionCommand cmd = previousCommands.OfType <MediaPoolClipDescriptionCommand>().Single(c => c.Index == index);
                        cmd.IsUsed = true;

                        // Set it to true first
                        stateBefore.MediaPool.Clips[index].IsUsed = true;
                        helper.SendFromServerAndWaitForChange(stateBefore, cmd);

                        // Now set invalid
                        stateBefore.MediaPool.Clips[index].IsUsed = false;
                        helper.SendAndWaitForChange(stateBefore, () => { clip.SetInvalid(); });
                    }
                }
            });
        }
コード例 #2
0
        public void TestIsUsed()
        {
            AtemMockServerWrapper.Each(_output, _pool, null, DeviceTestCases.MediaPlayerClips, helper =>
            {
                ImmutableList <ICommand> previousCommands = helper.Server.GetParsedDataDump();

                int clipCount = helper.Helper.BuildLibState().MediaPool.Clips.Count;
                for (int index = 0; index < clipCount; index++)
                {
                    AtemState stateBefore = helper.Helper.BuildLibState();

                    for (int i = 0; i < 5; i++)
                    {
                        MediaPoolClipDescriptionCommand cmd = previousCommands.OfType <MediaPoolClipDescriptionCommand>().Single(c => c.Index == index);
                        cmd.IsUsed = i % 2 == 0;
                        cmd.Name   = cmd.IsUsed ? "abc" : "";

                        stateBefore.MediaPool.Clips[index].IsUsed = cmd.IsUsed;
                        stateBefore.MediaPool.Clips[index].Name   = cmd.Name;

                        helper.SendFromServerAndWaitForChange(stateBefore, cmd);
                    }
                }
            });
        }