File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Tests/Nest.Tests.Unit/Core/Repository Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -111,9 +111,10 @@ public RestoreDescriptor RenameReplacement(string renameReplacement)
111111 return this ;
112112 }
113113
114- public RestoreDescriptor IndexSettings ( Func < UpdateSettingsDescriptor , UpdateSettingsDescriptor > settings )
114+ public RestoreDescriptor IndexSettings ( Func < UpdateSettingsDescriptor , UpdateSettingsDescriptor > settingsSelector )
115115 {
116- Self . IndexSettings = settings ( new UpdateSettingsDescriptor ( ) ) ;
116+ settingsSelector . ThrowIfNull ( "settings" ) ;
117+ Self . IndexSettings = settingsSelector ( new UpdateSettingsDescriptor ( ) ) ;
117118 return this ;
118119 }
119120
Original file line number Diff line number Diff line change @@ -29,24 +29,26 @@ public void Restore()
2929 }
3030
3131 [ Test ]
32- [ ExpectedException ]
32+ [ ExpectedException ( typeof ( ArgumentNullException ) ) ]
3333 public void Null_IgnoreIndexSettings_ThorwException ( )
3434 {
3535 List < string > ignoreIndexSettings = null ;
3636 _client . Restore ( "repository" , "snapshotName" ,
3737 descriptor => descriptor
38+ . Index ( "index" )
3839 . IgnoreIndexSettings ( ignoreIndexSettings ) ) ;
3940 }
4041
4142 [ Test ]
42- [ ExpectedException ]
43+ [ ExpectedException ( typeof ( ArgumentNullException ) ) ]
4344 public void Null_IndexSettings_ThorwException ( )
4445 {
45- Func < UpdateSettingsDescriptor , UpdateSettingsDescriptor > settings = null ;
46+ Func < UpdateSettingsDescriptor , UpdateSettingsDescriptor > settingsSelector = null ;
4647
4748 var restoreResponse = _client . Restore ( "repository" , "snapshotName" ,
4849 descriptor => descriptor
49- . IndexSettings ( settings ) ) ;
50+ . Index ( "index" )
51+ . IndexSettings ( settingsSelector ) ) ;
5052 }
5153 }
5254}
You can’t perform that action at this time.
0 commit comments