public void ControlManagementUpdateControlTest() { bool success = false; Control control = new Control(); control.keybind.FirstKey = KeybindEnum.CTRL; control.keybind.SecondKey = "9"; control.command.command_name = "no-osd change-list glsl-shaders set"; control.command.values.Add(ShaderEnum.AutoDownscale); control.command.values.Add(ShaderEnum.DarkLinesHQ); control.command.values.Add(ShaderEnum.ResamplingArtifactLarge); control.command.values.Add(ShaderEnum.UpscaleUltra); ControlManagement.SetControl(control); Control newControl = new Control(); newControl.keybind.FirstKey = KeybindEnum.SHIFT; newControl.keybind.SecondKey = "0"; newControl.command.command_name = "no-osd change-list glsl-shaders set"; newControl.command.values.Add(ShaderEnum.AutoDownscale); newControl.command.values.Add(ShaderEnum.DeblurLarge); newControl.command.values.Add(ShaderEnum.UpscaleOriginal); newControl.command.values.Add(ShaderEnum.UpscaleUltraDenoise); ControlManagement.UpdateControl(control, newControl); List <Control> cList = ControlManagement.GetControls(); if (cList.Contains(newControl) && !cList.Contains(control)) { success = true; ControlManagement.DeleteControl(newControl); } Assert.IsTrue(success); }
public void ControlDuplicateTest() { bool success = true; Control control = new Control { keybind = new Keybind("CTRL+9"), command = new Command { command_name = "no-osd change-list glsl-shaders set", values = new List <ShaderEnum> { ShaderEnum.ACNet, ShaderEnum.DarkLinesHQ } }, Comment = "Test" }; shader_configurator.DAL.ControlManagement.SetControl(control); List <Control> cList = ControlManagement.GetControls(); ControlManagement.SetControl(control); if (cList.FindAll(x => x == control).Count > 1) { success = false; } ControlManagement.DeleteControl(control); Assert.IsTrue(success); }
private void buttonUpdate_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("Are you sure you want to update the paths for ALL profiles?", "Action Confirmation", MessageBoxButtons.YesNoCancel); if (result == DialogResult.Yes) { ControlManagement.SetControls(ControlManagement.GetControls()); SetControlList(); } }
public static bool IsDuplicateKeyBinding(Keybind keybind) { bool duplicate = false; Control control = ControlManagement.GetControls().Find(x => x.keybind.Equals(keybind)); if (control != null) { duplicate = true; } return(duplicate); }
public void ControtSetDefaultTest() { bool success = false; List <Control> defaultControls = ControlManagement.defaultControls; List <Control> oldControls = ControlManagement.GetControls(); ControlManagement.SetControls(); List <Control> newControls = ControlManagement.GetControls(); if (defaultControls.All(newControls.Contains) && defaultControls.Count == newControls.Count) { success = true; } ControlManagement.SetControls(oldControls); Assert.IsTrue(success); }
public void ControlManagementDeleteControlTest() { Control control = new Control(); control.keybind.FirstKey = KeybindEnum.CTRL; control.keybind.SecondKey = "7"; control.command.command_name = "no-osd change-list glsl-shaders set"; control.command.values.Add(ShaderEnum.AutoDownscale); control.command.values.Add(ShaderEnum.DarkLinesHQ); control.command.values.Add(ShaderEnum.ResamplingArtifactLarge); control.command.values.Add(ShaderEnum.UpscaleUltra); ControlManagement.SetControl(control); ControlManagement.DeleteControl(control); List <Control> cList = ControlManagement.GetControls(); Assert.IsTrue(!cList.Contains(control)); }
public void ControlManagementSetControlTest() { bool success = false; //Control Initialization Control control = new Control(); control.keybind.FirstKey = KeybindEnum.SHIFT; control.keybind.SecondKey = "2"; control.command.command_name = "no-osd change-list glsl-shaders set"; control.command.values.Add(ShaderEnum.AutoDownscale); control.command.values.Add(ShaderEnum.DarkLinesHQ); control.command.values.Add(ShaderEnum.ResamplingArtifactLarge); control.command.values.Add(ShaderEnum.UpscaleUltra); ControlManagement.SetControl(control); List <Control> cList = ControlManagement.GetControls(); if (cList.Contains(control)) { success = true; ControlManagement.DeleteControl(control); } Assert.IsTrue(success); }
public static bool IsDuplicateControl(Control control) { return(ControlManagement.GetControls().Contains(control)); }
public void ControlManagementGetControlsTest() { Assert.AreEqual(typeof(List <Control>), ControlManagement.GetControls().GetType()); }