@@ -60,13 +60,12 @@ public void UserSettingsAreCombinedWithDefaultSettings()
60
60
[ Test ]
61
61
public void UserSettingsAreNotDuplicatedWithDefaultSettings ( )
62
62
{
63
+ var inspectionMock = new Mock < IInspection > ( ) ;
64
+ inspectionMock . Setup ( inspection => inspection . Name ) . Returns ( "Foo" ) ;
63
65
var inspectionProviderMock = new Mock < IInspectionProvider > ( ) ;
64
- inspectionProviderMock . Setup ( provider => provider . Inspections ) . Returns ( Enumerable . Empty < IInspection > ( ) ) ;
65
-
66
- var defaultSettings = new CodeInspectionConfigProvider ( null , inspectionProviderMock . Object ) . CreateDefaults ( ) . CodeInspections ;
67
- var defaultSetting = defaultSettings . First ( ) ;
66
+ inspectionProviderMock . Setup ( provider => provider . Inspections ) . Returns ( new [ ] { inspectionMock . Object } ) ;
68
67
69
- var userSetting = new CodeInspectionSetting ( defaultSetting . Name , defaultSetting . InspectionType ) ;
68
+ var userSetting = new CodeInspectionSetting ( inspectionMock . Object . Name , inspectionMock . Object . InspectionType ) ;
70
69
var userSettings = new CodeInspectionSettings
71
70
{
72
71
CodeInspections = new HashSet < CodeInspectionSetting > ( new [ ] { userSetting } )
@@ -76,11 +75,9 @@ public void UserSettingsAreNotDuplicatedWithDefaultSettings()
76
75
persisterMock . Setup ( persister => persister . Load ( It . IsAny < CodeInspectionSettings > ( ) ) ) . Returns ( userSettings ) ;
77
76
78
77
var configProvider = new CodeInspectionConfigProvider ( persisterMock . Object , inspectionProviderMock . Object ) ;
79
-
80
78
var settings = configProvider . Create ( ) . CodeInspections ;
81
79
82
- Assert . AreEqual ( defaultSettings . Count , settings . Count ) ;
83
- Assert . Contains ( userSetting , settings . ToArray ( ) ) ;
80
+ Assert . AreEqual ( configProvider . CreateDefaults ( ) . CodeInspections . Count , settings . Count ) ;
84
81
}
85
82
86
83
0 commit comments