public void ResetSettingsDisposesRootKey() { RegistryKey rootKey = this.GetTestRegistryKey(); var options = new TestableT4ToolboxOptions(() => rootKey); options.ResetSettings(); rootKey.GetValueNames(); // ObjectDisposedException here }
public void ResetSettingsChangesPropertiesWithoutDefaultValueAttributeToDefaultTypeValue() { var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey); options.BoolPropertyWithoutDefaultValueAttribute = true; options.ResetSettings(); Assert.IsFalse(options.BoolPropertyWithoutDefaultValueAttribute); }
public void ResetSettingsChangesPropertiesToValuesSpecifiedInDefaultValueAttribute() { var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey); options.SyntaxColorizationEnabled = false; options.ResetSettings(); Assert.IsTrue(options.SyntaxColorizationEnabled); }
public void ResetSettingsDeletesRegistryKey() { using (RegistryKey rootKey = this.GetTestRegistryKey()) { rootKey.CreateSubKey("T4 Toolbox"); } var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey); options.ResetSettings(); using (RegistryKey root = this.GetTestRegistryKey()) { Assert.IsFalse(root.GetSubKeyNames().Any()); } }
public void ResetSettingsDoesNotThrowWhenRegistryKeyDoesNotExist() { var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey); options.ResetSettings(); }