@@ -130,7 +130,7 @@ bool cb(string name, string value)
130
130
}
131
131
132
132
[ Fact ]
133
- public void GitConfiguration_TryGetValue_Name_Exists_ReturnsTrueOutString ( )
133
+ public void GitConfiguration_TryGet_Name_Exists_ReturnsTrueOutString ( )
134
134
{
135
135
string repoPath = CreateRepository ( out string workDirPath ) ;
136
136
Git ( repoPath , workDirPath , "config --local user.name john.doe" ) . AssertSuccess ( ) ;
@@ -140,14 +140,14 @@ public void GitConfiguration_TryGetValue_Name_Exists_ReturnsTrueOutString()
140
140
var git = new GitProcess ( trace , gitPath , repoPath ) ;
141
141
IGitConfiguration config = git . GetConfiguration ( ) ;
142
142
143
- bool result = config . TryGetValue ( "user.name" , out string value ) ;
143
+ bool result = config . TryGet ( "user.name" , out string value ) ;
144
144
Assert . True ( result ) ;
145
145
Assert . NotNull ( value ) ;
146
146
Assert . Equal ( "john.doe" , value ) ;
147
147
}
148
148
149
149
[ Fact ]
150
- public void GitConfiguration_TryGetValue_Name_DoesNotExists_ReturnsFalse ( )
150
+ public void GitConfiguration_TryGet_Name_DoesNotExists_ReturnsFalse ( )
151
151
{
152
152
string repoPath = CreateRepository ( ) ;
153
153
@@ -157,13 +157,13 @@ public void GitConfiguration_TryGetValue_Name_DoesNotExists_ReturnsFalse()
157
157
IGitConfiguration config = git . GetConfiguration ( ) ;
158
158
159
159
string randomName = $ "{ Guid . NewGuid ( ) : N} .{ Guid . NewGuid ( ) : N} ";
160
- bool result = config . TryGetValue ( randomName , out string value ) ;
160
+ bool result = config . TryGet ( randomName , out string value ) ;
161
161
Assert . False ( result ) ;
162
162
Assert . Null ( value ) ;
163
163
}
164
164
165
165
[ Fact ]
166
- public void GitConfiguration_TryGetValue_SectionProperty_Exists_ReturnsTrueOutString ( )
166
+ public void GitConfiguration_TryGet_SectionProperty_Exists_ReturnsTrueOutString ( )
167
167
{
168
168
string repoPath = CreateRepository ( out string workDirPath ) ;
169
169
Git ( repoPath , workDirPath , "config --local user.name john.doe" ) . AssertSuccess ( ) ;
@@ -173,14 +173,14 @@ public void GitConfiguration_TryGetValue_SectionProperty_Exists_ReturnsTrueOutSt
173
173
var git = new GitProcess ( trace , gitPath , repoPath ) ;
174
174
IGitConfiguration config = git . GetConfiguration ( ) ;
175
175
176
- bool result = config . TryGetValue ( "user" , "name" , out string value ) ;
176
+ bool result = config . TryGet ( "user" , "name" , out string value ) ;
177
177
Assert . True ( result ) ;
178
178
Assert . NotNull ( value ) ;
179
179
Assert . Equal ( "john.doe" , value ) ;
180
180
}
181
181
182
182
[ Fact ]
183
- public void GitConfiguration_TryGetValue_SectionProperty_DoesNotExists_ReturnsFalse ( )
183
+ public void GitConfiguration_TryGet_SectionProperty_DoesNotExists_ReturnsFalse ( )
184
184
{
185
185
string repoPath = CreateRepository ( ) ;
186
186
@@ -191,13 +191,13 @@ public void GitConfiguration_TryGetValue_SectionProperty_DoesNotExists_ReturnsFa
191
191
192
192
string randomSection = Guid . NewGuid ( ) . ToString ( "N" ) ;
193
193
string randomProperty = Guid . NewGuid ( ) . ToString ( "N" ) ;
194
- bool result = config . TryGetValue ( randomSection , randomProperty , out string value ) ;
194
+ bool result = config . TryGet ( randomSection , randomProperty , out string value ) ;
195
195
Assert . False ( result ) ;
196
196
Assert . Null ( value ) ;
197
197
}
198
198
199
199
[ Fact ]
200
- public void GitConfiguration_TryGetValue_SectionScopeProperty_Exists_ReturnsTrueOutString ( )
200
+ public void GitConfiguration_TryGet_SectionScopeProperty_Exists_ReturnsTrueOutString ( )
201
201
{
202
202
string repoPath = CreateRepository ( out string workDirPath ) ;
203
203
Git ( repoPath , workDirPath , "config --local user.example.com.name john.doe" ) . AssertSuccess ( ) ;
@@ -207,14 +207,14 @@ public void GitConfiguration_TryGetValue_SectionScopeProperty_Exists_ReturnsTrue
207
207
var git = new GitProcess ( trace , gitPath , repoPath ) ;
208
208
IGitConfiguration config = git . GetConfiguration ( ) ;
209
209
210
- bool result = config . TryGetValue ( "user" , "example.com" , "name" , out string value ) ;
210
+ bool result = config . TryGet ( "user" , "example.com" , "name" , out string value ) ;
211
211
Assert . True ( result ) ;
212
212
Assert . NotNull ( value ) ;
213
213
Assert . Equal ( "john.doe" , value ) ;
214
214
}
215
215
216
216
[ Fact ]
217
- public void GitConfiguration_TryGetValue_SectionScopeProperty_NullScope_ReturnsTrueOutUnscopedString ( )
217
+ public void GitConfiguration_TryGet_SectionScopeProperty_NullScope_ReturnsTrueOutUnscopedString ( )
218
218
{
219
219
string repoPath = CreateRepository ( out string workDirPath ) ;
220
220
Git ( repoPath , workDirPath , "config --local user.name john.doe" ) . AssertSuccess ( ) ;
@@ -224,14 +224,14 @@ public void GitConfiguration_TryGetValue_SectionScopeProperty_NullScope_ReturnsT
224
224
var git = new GitProcess ( trace , gitPath , repoPath ) ;
225
225
IGitConfiguration config = git . GetConfiguration ( ) ;
226
226
227
- bool result = config . TryGetValue ( "user" , null , "name" , out string value ) ;
227
+ bool result = config . TryGet ( "user" , null , "name" , out string value ) ;
228
228
Assert . True ( result ) ;
229
229
Assert . NotNull ( value ) ;
230
230
Assert . Equal ( "john.doe" , value ) ;
231
231
}
232
232
233
233
[ Fact ]
234
- public void GitConfiguration_TryGetValue_SectionScopeProperty_DoesNotExists_ReturnsFalse ( )
234
+ public void GitConfiguration_TryGet_SectionScopeProperty_DoesNotExists_ReturnsFalse ( )
235
235
{
236
236
string repoPath = CreateRepository ( ) ;
237
237
@@ -243,7 +243,7 @@ public void GitConfiguration_TryGetValue_SectionScopeProperty_DoesNotExists_Retu
243
243
string randomSection = Guid . NewGuid ( ) . ToString ( "N" ) ;
244
244
string randomScope = Guid . NewGuid ( ) . ToString ( "N" ) ;
245
245
string randomProperty = Guid . NewGuid ( ) . ToString ( "N" ) ;
246
- bool result = config . TryGetValue ( randomSection , randomScope , randomProperty , out string value ) ;
246
+ bool result = config . TryGet ( randomSection , randomScope , randomProperty , out string value ) ;
247
247
Assert . False ( result ) ;
248
248
Assert . Null ( value ) ;
249
249
}
@@ -259,7 +259,7 @@ public void GitConfiguration_GetString_Name_Exists_ReturnsString()
259
259
var git = new GitProcess ( trace , gitPath , repoPath ) ;
260
260
IGitConfiguration config = git . GetConfiguration ( ) ;
261
261
262
- string value = config . GetValue ( "user.name" ) ;
262
+ string value = config . Get ( "user.name" ) ;
263
263
Assert . NotNull ( value ) ;
264
264
Assert . Equal ( "john.doe" , value ) ;
265
265
}
@@ -275,7 +275,7 @@ public void GitConfiguration_GetString_Name_DoesNotExists_ThrowsException()
275
275
IGitConfiguration config = git . GetConfiguration ( ) ;
276
276
277
277
string randomName = $ "{ Guid . NewGuid ( ) : N} .{ Guid . NewGuid ( ) : N} ";
278
- Assert . Throws < KeyNotFoundException > ( ( ) => config . GetValue ( randomName ) ) ;
278
+ Assert . Throws < KeyNotFoundException > ( ( ) => config . Get ( randomName ) ) ;
279
279
}
280
280
281
281
[ Fact ]
@@ -289,7 +289,7 @@ public void GitConfiguration_GetString_SectionProperty_Exists_ReturnsString()
289
289
var git = new GitProcess ( trace , gitPath , repoPath ) ;
290
290
IGitConfiguration config = git . GetConfiguration ( ) ;
291
291
292
- string value = config . GetValue ( "user" , "name" ) ;
292
+ string value = config . Get ( "user" , "name" ) ;
293
293
Assert . NotNull ( value ) ;
294
294
Assert . Equal ( "john.doe" , value ) ;
295
295
}
@@ -306,7 +306,7 @@ public void GitConfiguration_GetString_SectionProperty_DoesNotExists_ThrowsExcep
306
306
307
307
string randomSection = Guid . NewGuid ( ) . ToString ( "N" ) ;
308
308
string randomProperty = Guid . NewGuid ( ) . ToString ( "N" ) ;
309
- Assert . Throws < KeyNotFoundException > ( ( ) => config . GetValue ( randomSection , randomProperty ) ) ;
309
+ Assert . Throws < KeyNotFoundException > ( ( ) => config . Get ( randomSection , randomProperty ) ) ;
310
310
}
311
311
312
312
[ Fact ]
@@ -320,7 +320,7 @@ public void GitConfiguration_GetString_SectionScopeProperty_Exists_ReturnsString
320
320
var git = new GitProcess ( trace , gitPath , repoPath ) ;
321
321
IGitConfiguration config = git . GetConfiguration ( ) ;
322
322
323
- string value = config . GetValue ( "user" , "example.com" , "name" ) ;
323
+ string value = config . Get ( "user" , "example.com" , "name" ) ;
324
324
Assert . NotNull ( value ) ;
325
325
Assert . Equal ( "john.doe" , value ) ;
326
326
}
@@ -336,7 +336,7 @@ public void GitConfiguration_GetString_SectionScopeProperty_NullScope_ReturnsUns
336
336
var git = new GitProcess ( trace , gitPath , repoPath ) ;
337
337
IGitConfiguration config = git . GetConfiguration ( ) ;
338
338
339
- string value = config . GetValue ( "user" , null , "name" ) ;
339
+ string value = config . Get ( "user" , null , "name" ) ;
340
340
Assert . NotNull ( value ) ;
341
341
Assert . Equal ( "john.doe" , value ) ;
342
342
}
@@ -354,11 +354,11 @@ public void GitConfiguration_GetString_SectionScopeProperty_DoesNotExists_Throws
354
354
string randomSection = Guid . NewGuid ( ) . ToString ( "N" ) ;
355
355
string randomScope = Guid . NewGuid ( ) . ToString ( "N" ) ;
356
356
string randomProperty = Guid . NewGuid ( ) . ToString ( "N" ) ;
357
- Assert . Throws < KeyNotFoundException > ( ( ) => config . GetValue ( randomSection , randomScope , randomProperty ) ) ;
357
+ Assert . Throws < KeyNotFoundException > ( ( ) => config . Get ( randomSection , randomScope , randomProperty ) ) ;
358
358
}
359
359
360
360
[ Fact ]
361
- public void GitConfiguration_SetValue_Local_SetsLocalConfig ( )
361
+ public void GitConfiguration_Set_Local_SetsLocalConfig ( )
362
362
{
363
363
string repoPath = CreateRepository ( out string workDirPath ) ;
364
364
@@ -367,15 +367,15 @@ public void GitConfiguration_SetValue_Local_SetsLocalConfig()
367
367
var git = new GitProcess ( trace , gitPath , repoPath ) ;
368
368
IGitConfiguration config = git . GetConfiguration ( GitConfigurationLevel . Local ) ;
369
369
370
- config . SetValue ( "core.foobar" , "foo123" ) ;
370
+ config . Set ( "core.foobar" , "foo123" ) ;
371
371
372
372
GitResult localResult = Git ( repoPath , workDirPath , "config --local core.foobar" ) ;
373
373
374
374
Assert . Equal ( "foo123" , localResult . StandardOutput . Trim ( ) ) ;
375
375
}
376
376
377
377
[ Fact ]
378
- public void GitConfiguration_SetValue_All_ThrowsException ( )
378
+ public void GitConfiguration_Set_All_ThrowsException ( )
379
379
{
380
380
string repoPath = CreateRepository ( out _ ) ;
381
381
@@ -384,7 +384,7 @@ public void GitConfiguration_SetValue_All_ThrowsException()
384
384
var git = new GitProcess ( trace , gitPath , repoPath ) ;
385
385
IGitConfiguration config = git . GetConfiguration ( GitConfigurationLevel . All ) ;
386
386
387
- Assert . Throws < InvalidOperationException > ( ( ) => config . SetValue ( "core.foobar" , "test123" ) ) ;
387
+ Assert . Throws < InvalidOperationException > ( ( ) => config . Set ( "core.foobar" , "test123" ) ) ;
388
388
}
389
389
390
390
[ Fact ]
0 commit comments