Example #1
0
        public void TestSetInvalid()
        {
            AtemMockServerWrapper.Each(_output, _pool, ClearCommandHandler, DeviceTestCases.MediaPlayer, helper =>
            {
                IBMDSwitcherStills stills = GetStillsPool(helper);

                ImmutableList <ICommand> previousCommands = helper.Server.GetParsedDataDump();

                for (int i = 0; i < 5; i++)
                {
                    AtemState stateBefore = helper.Helper.BuildLibState();

                    uint index = Randomiser.RangeInt((uint)stateBefore.MediaPool.Stills.Count);
                    MediaPoolFrameDescriptionCommand cmd = previousCommands.OfType <MediaPoolFrameDescriptionCommand>().Single(c => c.Index == index && c.Bank == MediaPoolFileType.Still);
                    cmd.IsUsed = true;

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

                    // Now set invalid
                    stateBefore.MediaPool.Stills[(int)index].IsUsed   = false;
                    stateBefore.MediaPool.Stills[(int)index].Filename = "";
                    stateBefore.MediaPool.Stills[(int)index].Hash     = new byte[16];
                    helper.SendAndWaitForChange(stateBefore, () =>
                    {
                        stills.SetInvalid(index);
                    });
                }
            });
        }
Example #2
0
        public void TestHash()
        {
            AtemMockServerWrapper.Each(_output, _pool, null, DeviceTestCases.MediaPlayer, helper =>
            {
                ImmutableList <ICommand> previousCommands = helper.Server.GetParsedDataDump();

                for (int i = 0; i < 5; i++)
                {
                    AtemState stateBefore = helper.Helper.BuildLibState();

                    uint index = Randomiser.RangeInt((uint)stateBefore.MediaPool.Stills.Count);
                    MediaPoolFrameDescriptionCommand cmd = previousCommands.OfType <MediaPoolFrameDescriptionCommand>().Single(c => c.Index == index && c.Bank == MediaPoolFileType.Still);
                    cmd.Hash = Guid.NewGuid().ToByteArray();

                    stateBefore.MediaPool.Stills[(int)index].Hash = cmd.Hash;

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