public void TestMode() { var handler = CommandGenerator.CreateAutoCommandHandler <MixMinusOutputSetCommand, MixMinusOutputGetCommand>("Mode"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.MixMinusOutputs, helper => { bool tested = false; List <IBMDSwitcherMixMinusOutput> outputs = GetMixMinusOutputs(helper); for (int id = 0; id < outputs.Count; id++) { IBMDSwitcherMixMinusOutput mixMinus = outputs[id]; tested = true; AtemState stateBefore = helper.Helper.BuildLibState(); SettingsState.MixMinusOutputState mixMinusState = stateBefore.Settings.MixMinusOutputs[id]; for (int i = 0; i < 5; i++) { MixMinusMode newValue = Randomiser.EnumValue <MixMinusMode>(); mixMinusState.Mode = newValue; helper.SendAndWaitForChange(stateBefore, () => { mixMinus.SetAudioMode(AtemEnumMaps.MixMinusModeMap[newValue]); }); } } Assert.True(tested); }); }
public void TestAvailableAudioModes() { var handler = CommandGenerator.CreateAutoCommandHandler <MixMinusOutputSetCommand, MixMinusOutputGetCommand>("Mode"); AtemMockServerWrapper.Each(_output, _pool, handler, DeviceTestCases.MixMinusOutputs, helper => { var previousCommands = helper.Server.GetParsedDataDump().OfType <MixMinusOutputGetCommand>().ToList(); for (int i = 0; i < 5; i++) { AtemState stateBefore = helper.Helper.BuildLibState(); uint id = Randomiser.RangeInt((uint)stateBefore.Settings.MixMinusOutputs.Count - 1); SettingsState.MixMinusOutputState mixMinusState = stateBefore.Settings.MixMinusOutputs[(int)id]; MixMinusOutputGetCommand cmd = previousCommands.Single(c => c.Id == id); MixMinusMode newValue = Randomiser.EnumValue <MixMinusMode>(); cmd.SupportedModes = newValue; mixMinusState.SupportedModes = newValue; helper.SendFromServerAndWaitForChange(stateBefore, cmd); } }); }