private static void CheckAndUncheckSetting(AutomationRunner testRunner, string settingToChange, bool printer, bool expected) { // Assert that the checkbox is currently unchecked, and there is no user override Assert.IsTrue(ActiveSliceSettings.Instance.UserLayer.ContainsKey(settingToChange) == false); // Click the checkbox SetCheckBoxSetting(testRunner, settingToChange, printer, !expected); // Assert the checkbox is checked and the user override is set Assert.IsTrue(ActiveSliceSettings.Instance.UserLayer.ContainsKey(settingToChange) == true); // make sure the setting is still open in case of a reload all testRunner.NavigateToSliceSettingsField("Printer", settingToChange); // Click the cancel user override button testRunner.ClickByName("Restore " + settingToChange); testRunner.Delay(2); // Assert the checkbox is unchecked and there is no user override Assert.IsTrue(ActiveSliceSettings.Instance.GetValue <bool>(settingToChange) == expected); Assert.IsTrue(ActiveSliceSettings.Instance.UserLayer.ContainsKey(settingToChange) == false); }