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 buttonDelete_Click(object sender, EventArgs e) { string str = @"CTRL+ALT+1 no-osd change-list glsl-shaders set ""~~/shaders/Anime4K_Upscale_Original_x2.glsl;~~/shaders/Anime4K_DarkLines_Fast.glsl;~~/shaders/Anime4K_Auto_Downscale_Pre_x4.glsl"""; Control control = new Control(str); ControlManagement.DeleteControl(control); MessageBox.Show("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); }