File tree Expand file tree Collapse file tree 4 files changed +29
-18
lines changed Expand file tree Collapse file tree 4 files changed +29
-18
lines changed Original file line number Diff line number Diff line change @@ -35,5 +35,20 @@ public override string ToString()
35
35
{
36
36
return Key ;
37
37
}
38
+
39
+ public override bool Equals ( object obj )
40
+ {
41
+ return obj is ExperimentalFeatures value &&
42
+ value . IsEnabled == IsEnabled &&
43
+ value . Key == Key ;
44
+ }
45
+
46
+ public override int GetHashCode ( )
47
+ {
48
+ unchecked
49
+ {
50
+ return ( IsEnabled . GetHashCode ( ) * 397 ) ^ ( Key != null ? Key . GetHashCode ( ) : 0 ) ;
51
+ }
52
+ }
38
53
}
39
54
}
Original file line number Diff line number Diff line change @@ -159,20 +159,6 @@ public MinimumLogLevel SelectedLogLevel
159
159
}
160
160
}
161
161
162
- private bool _sourceControlEnabled ;
163
- public bool SourceControlEnabled
164
- {
165
- get => _sourceControlEnabled ;
166
- set
167
- {
168
- if ( _sourceControlEnabled != value )
169
- {
170
- _sourceControlEnabled = value ;
171
- OnPropertyChanged ( ) ;
172
- }
173
- }
174
- }
175
-
176
162
public CommandBase ShowLogFolderCommand { get ; }
177
163
178
164
private void ShowLogFolder ( )
Original file line number Diff line number Diff line change @@ -2052,14 +2052,14 @@ Would you like to import them to Rubberduck?</value>
2052
2052
<value >Method '{0}' is an implementation of event '{1}.{2}'. Rename event '{2}' instead?</value >
2053
2053
<comment >0: Selected target Identifier; 1: Event Parent; 2: Event name</comment >
2054
2054
</data >
2055
- <data name =" GeneralSettings_EnableExperimentalFeatures " xml : space =" preserve" >
2056
- <value >Enable experimental features. Requires a restart to take effect .</value >
2055
+ <data name =" GeneralSettings_EnableSourceControl " xml : space =" preserve" >
2056
+ <value >Enable Source Control .</value >
2057
2057
</data >
2058
2058
<data name =" GeneralSettings_ExperimentalFeaturesWarning" xml : space =" preserve" >
2059
2059
<value >Only enable these if you know what you're doing. Enabling and/or using features from this section may result in things breaking unexpectedly and irrevocable data loss.</value >
2060
2060
</data >
2061
2061
<data name =" GeneralSettings_ExperimentalFeatures" xml : space =" preserve" >
2062
- <value >Experimental Features:</value >
2062
+ <value >Experimental Features (Requires a restart to take effect) :</value >
2063
2063
</data >
2064
2064
<data name =" ToolsMenu_ExportProject" xml : space =" preserve" >
2065
2065
<value >Export Active Project...</value >
Original file line number Diff line number Diff line change
1
+ using System . Collections . Generic ;
1
2
using System . Linq ;
2
3
using Microsoft . VisualStudio . TestTools . UnitTesting ;
3
4
using Rubberduck . Settings ;
4
5
using Rubberduck . UI . Settings ;
5
6
using GeneralSettings = Rubberduck . Settings . GeneralSettings ;
6
7
using Rubberduck . Common ;
7
8
using Moq ;
9
+ using Rubberduck . UI ;
8
10
9
11
namespace RubberduckTests . Settings
10
12
{
@@ -23,6 +25,14 @@ private Configuration GetDefaultConfig()
23
25
Language = new DisplayLanguageSetting ( "en-US" ) ,
24
26
IsAutoSaveEnabled = false ,
25
27
AutoSavePeriod = 10 ,
28
+ EnableExperimentalFeatures = new List < ExperimentalFeatures >
29
+ {
30
+ new ExperimentalFeatures
31
+ {
32
+ Key = nameof ( RubberduckUI . GeneralSettings_EnableSourceControl ) ,
33
+ IsEnabled = true
34
+ }
35
+ }
26
36
//Delimiter = '.'
27
37
} ;
28
38
@@ -142,7 +152,7 @@ public void SourceControlEnabledIsSetInCtor()
142
152
var defaultConfig = GetDefaultConfig ( ) ;
143
153
var viewModel = new GeneralSettingsViewModel ( defaultConfig , GetOperatingSystemMock ( ) . Object ) ;
144
154
145
- Assert . AreEqual ( defaultConfig . UserSettings . GeneralSettings . EnableExperimentalFeatures , viewModel . SourceControlEnabled ) ;
155
+ Assert . IsTrue ( defaultConfig . UserSettings . GeneralSettings . EnableExperimentalFeatures . SequenceEqual ( viewModel . ExperimentalFeatures ) ) ;
146
156
}
147
157
148
158
//[TestCategory("Settings")]
You can’t perform that action at this time.
0 commit comments