示例#1
0
        public void ResetSettingsDisposesRootKey()
        {
            RegistryKey rootKey = this.GetTestRegistryKey();
            var         options = new TestableT4ToolboxOptions(() => rootKey);

            options.ResetSettings();
            rootKey.GetValueNames(); // ObjectDisposedException here
        }
示例#2
0
        public void ResetSettingsChangesPropertiesWithoutDefaultValueAttributeToDefaultTypeValue()
        {
            var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey);

            options.BoolPropertyWithoutDefaultValueAttribute = true;
            options.ResetSettings();
            Assert.IsFalse(options.BoolPropertyWithoutDefaultValueAttribute);
        }
示例#3
0
        public void ResetSettingsChangesPropertiesToValuesSpecifiedInDefaultValueAttribute()
        {
            var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey);

            options.SyntaxColorizationEnabled = false;
            options.ResetSettings();
            Assert.IsTrue(options.SyntaxColorizationEnabled);
        }
示例#4
0
        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 ResetSettingsDisposesRootKey()
 {
     RegistryKey rootKey = this.GetTestRegistryKey();
     var options = new TestableT4ToolboxOptions(() => rootKey);
     options.ResetSettings();
     rootKey.GetValueNames(); // ObjectDisposedException here            
 }
 public void ResetSettingsDoesNotThrowWhenRegistryKeyDoesNotExist()
 {
     var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey);
     options.ResetSettings();
 }
        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 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);
 }
示例#10
0
        public void ResetSettingsDoesNotThrowWhenRegistryKeyDoesNotExist()
        {
            var options = new TestableT4ToolboxOptions(this.GetTestRegistryKey);

            options.ResetSettings();
        }