@@ -19,7 +19,7 @@ public class ConfigurationProviderTests : TestBase
19
19
private const string DefaultRepoPath = @"c:\MyGitRepo" ;
20
20
21
21
private string repoPath ;
22
- private IConfigurationProvider configProvider ;
22
+ private IConfigurationProvider configurationProvider ;
23
23
private IFileSystem fileSystem ;
24
24
25
25
[ SetUp ]
@@ -28,7 +28,7 @@ public void Setup()
28
28
this . repoPath = DefaultRepoPath ;
29
29
var options = Options . Create ( new GitVersionOptions { WorkingDirectory = repoPath } ) ;
30
30
var sp = ConfigureServices ( services => services . AddSingleton ( options ) ) ;
31
- this . configProvider = sp . GetRequiredService < IConfigurationProvider > ( ) ;
31
+ this . configurationProvider = sp . GetRequiredService < IConfigurationProvider > ( ) ;
32
32
this . fileSystem = sp . GetRequiredService < IFileSystem > ( ) ;
33
33
34
34
ShouldlyConfiguration . ShouldMatchApprovedDefaults . LocateTestMethodUsingAttribute < TestAttribute > ( ) ;
@@ -37,15 +37,15 @@ public void Setup()
37
37
[ Test ]
38
38
public void OverwritesDefaultsWithProvidedConfig ( )
39
39
{
40
- var defaultConfig = this . configProvider . Provide ( this . repoPath ) ;
40
+ var defaultConfig = this . configurationProvider . Provide ( this . repoPath ) ;
41
41
const string text = @"
42
42
next-version: 2.0.0
43
43
branches:
44
44
develop:
45
45
mode: ContinuousDeployment
46
46
tag: dev" ;
47
47
SetupConfigFileContent ( text ) ;
48
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
48
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
49
49
50
50
configuration . NextVersion . ShouldBe ( "2.0.0" ) ;
51
51
configuration . Branches . ShouldNotBeNull ( ) ;
@@ -59,7 +59,7 @@ public void AllBranchesModeWhenUsingMainline()
59
59
{
60
60
const string text = "mode: Mainline" ;
61
61
SetupConfigFileContent ( text ) ;
62
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
62
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
63
63
var branches = configuration . Branches . Select ( x => x . Value ) ;
64
64
branches . All ( branch => branch . VersioningMode == VersioningMode . Mainline ) . ShouldBe ( true ) ;
65
65
}
@@ -73,7 +73,7 @@ public void CanRemoveTag()
73
73
release:
74
74
tag: """"" ;
75
75
SetupConfigFileContent ( text ) ;
76
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
76
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
77
77
78
78
configuration . NextVersion . ShouldBe ( "2.0.0" ) ;
79
79
configuration . Branches [ "release" ] . Tag . ShouldBe ( string . Empty ) ;
@@ -88,7 +88,7 @@ public void RegexIsRequired()
88
88
bug:
89
89
tag: bugfix" ;
90
90
SetupConfigFileContent ( text ) ;
91
- var ex = Should . Throw < ConfigurationException > ( ( ) => this . configProvider . Provide ( this . repoPath ) ) ;
91
+ var ex = Should . Throw < ConfigurationException > ( ( ) => this . configurationProvider . Provide ( this . repoPath ) ) ;
92
92
ex . Message . ShouldBe ( $ "Branch configuration 'bug' is missing required configuration 'regex'{ System . Environment . NewLine } " +
93
93
"See https://gitversion.net/docs/reference/configuration for more info" ) ;
94
94
}
@@ -103,7 +103,7 @@ public void SourceBranchIsRequired()
103
103
regex: 'bug[/-]'
104
104
tag: bugfix" ;
105
105
SetupConfigFileContent ( text ) ;
106
- var ex = Should . Throw < ConfigurationException > ( ( ) => this . configProvider . Provide ( this . repoPath ) ) ;
106
+ var ex = Should . Throw < ConfigurationException > ( ( ) => this . configurationProvider . Provide ( this . repoPath ) ) ;
107
107
ex . Message . ShouldBe ( $ "Branch configuration 'bug' is missing required configuration 'source-branches'{ System . Environment . NewLine } " +
108
108
"See https://gitversion.net/docs/reference/configuration for more info" ) ;
109
109
}
@@ -118,7 +118,7 @@ public void SourceBranchesValidationShouldFailWhenMatchingBranchConfigurationIsM
118
118
tag: bugfix
119
119
source-branches: [notconfigured]" ;
120
120
SetupConfigFileContent ( text ) ;
121
- var ex = Should . Throw < ConfigurationException > ( ( ) => this . configProvider . Provide ( this . repoPath ) ) ;
121
+ var ex = Should . Throw < ConfigurationException > ( ( ) => this . configurationProvider . Provide ( this . repoPath ) ) ;
122
122
ex . Message . ShouldBe ( $ "Branch configuration 'bug' defines these 'source-branches' that are not configured: '[notconfigured]'{ System . Environment . NewLine } " +
123
123
"See https://gitversion.net/docs/reference/configuration for more info" ) ;
124
124
}
@@ -135,7 +135,7 @@ public void SourceBranchesValidationShouldSucceedForWellKnownBranches(string wel
135
135
tag: bugfix
136
136
source-branches: [{ wellKnownBranchKey } ]" ;
137
137
SetupConfigFileContent ( text ) ;
138
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
138
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
139
139
140
140
configuration . Branches [ "bug" ] . SourceBranches . ShouldBe ( new List < string > { wellKnownBranchKey } ) ;
141
141
}
@@ -151,7 +151,7 @@ public void CanProvideConfigForNewBranch()
151
151
tag: bugfix
152
152
source-branches: []" ;
153
153
SetupConfigFileContent ( text ) ;
154
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
154
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
155
155
156
156
configuration . Branches [ "bug" ] . Regex . ShouldBe ( "bug[/-]" ) ;
157
157
configuration . Branches [ "bug" ] . Tag . ShouldBe ( "bugfix" ) ;
@@ -168,7 +168,7 @@ public void MasterConfigReplacedWithMain()
168
168
tag: beta" ;
169
169
SetupConfigFileContent ( text ) ;
170
170
171
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
171
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
172
172
173
173
configuration . Branches [ MainBranch ] . Regex . ShouldBe ( "^master$|^main$" ) ;
174
174
configuration . Branches [ MainBranch ] . Tag . ShouldBe ( "beta" ) ;
@@ -188,7 +188,7 @@ public void MasterConfigReplacedWithMainInSourceBranches()
188
188
is-release-branch: false" ;
189
189
SetupConfigFileContent ( text ) ;
190
190
191
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
191
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
192
192
193
193
configuration . Branches [ "breaking" ] . Regex . ShouldBe ( "breaking[/]" ) ;
194
194
configuration . Branches [ "breaking" ] . SourceBranches . ShouldHaveSingleItem ( ) ;
@@ -200,7 +200,7 @@ public void NextVersionCanBeInteger()
200
200
{
201
201
const string text = "next-version: 2" ;
202
202
SetupConfigFileContent ( text ) ;
203
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
203
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
204
204
205
205
configuration . NextVersion . ShouldBe ( "2.0" ) ;
206
206
}
@@ -210,7 +210,7 @@ public void NextVersionCanHaveEnormousMinorVersion()
210
210
{
211
211
const string text = "next-version: 2.118998723" ;
212
212
SetupConfigFileContent ( text ) ;
213
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
213
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
214
214
215
215
configuration . NextVersion . ShouldBe ( "2.118998723" ) ;
216
216
}
@@ -220,7 +220,7 @@ public void NextVersionCanHavePatch()
220
220
{
221
221
const string text = "next-version: 2.12.654651698" ;
222
222
SetupConfigFileContent ( text ) ;
223
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
223
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
224
224
225
225
configuration . NextVersion . ShouldBe ( "2.12.654651698" ) ;
226
226
}
@@ -229,7 +229,7 @@ public void NextVersionCanHavePatch()
229
229
[ MethodImpl ( MethodImplOptions . NoInlining ) ]
230
230
public void CanWriteOutEffectiveConfiguration ( )
231
231
{
232
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
232
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
233
233
234
234
configuration . ToString ( ) . ShouldMatchApproved ( ) ;
235
235
}
@@ -244,7 +244,7 @@ public void CanUpdateAssemblyInformationalVersioningScheme()
244
244
245
245
SetupConfigFileContent ( text ) ;
246
246
247
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
247
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
248
248
configuration . AssemblyVersioningScheme . ShouldBe ( AssemblyVersioningScheme . MajorMinor ) ;
249
249
configuration . AssemblyFileVersioningScheme . ShouldBe ( AssemblyFileVersioningScheme . MajorMinorPatch ) ;
250
250
configuration . AssemblyInformationalFormat . ShouldBe ( "{NugetVersion}" ) ;
@@ -260,7 +260,7 @@ public void CanUpdateAssemblyInformationalVersioningSchemeWithMultipleVariables(
260
260
261
261
SetupConfigFileContent ( text ) ;
262
262
263
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
263
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
264
264
configuration . AssemblyVersioningScheme . ShouldBe ( AssemblyVersioningScheme . MajorMinor ) ;
265
265
configuration . AssemblyFileVersioningScheme . ShouldBe ( AssemblyFileVersioningScheme . MajorMinorPatch ) ;
266
266
configuration . AssemblyInformationalFormat . ShouldBe ( "{Major}.{Minor}.{Patch}" ) ;
@@ -279,7 +279,7 @@ public void CanUpdateAssemblyInformationalVersioningSchemeWithFullSemVer()
279
279
280
280
SetupConfigFileContent ( text ) ;
281
281
282
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
282
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
283
283
configuration . AssemblyVersioningScheme . ShouldBe ( AssemblyVersioningScheme . MajorMinorPatch ) ;
284
284
configuration . AssemblyFileVersioningScheme . ShouldBe ( AssemblyFileVersioningScheme . MajorMinorPatch ) ;
285
285
configuration . AssemblyInformationalFormat . ShouldBe ( "{FullSemVer}" ) ;
@@ -290,7 +290,7 @@ public void CanReadDefaultDocument()
290
290
{
291
291
const string text = "" ;
292
292
SetupConfigFileContent ( text ) ;
293
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
293
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
294
294
configuration . AssemblyVersioningScheme . ShouldBe ( AssemblyVersioningScheme . MajorMinorPatch ) ;
295
295
configuration . AssemblyFileVersioningScheme . ShouldBe ( AssemblyFileVersioningScheme . MajorMinorPatch ) ;
296
296
configuration . AssemblyInformationalFormat . ShouldBe ( null ) ;
@@ -329,9 +329,9 @@ public void NoWarnOnGitVersionYmlFile()
329
329
services . AddSingleton ( options ) ;
330
330
services . AddSingleton < ILog > ( log ) ;
331
331
} ) ;
332
- this . configProvider = sp . GetRequiredService < IConfigurationProvider > ( ) ;
332
+ this . configurationProvider = sp . GetRequiredService < IConfigurationProvider > ( ) ;
333
333
334
- this . configProvider . Provide ( this . repoPath ) ;
334
+ this . configurationProvider . Provide ( this . repoPath ) ;
335
335
336
336
stringLogger . Length . ShouldBe ( 0 ) ;
337
337
}
@@ -355,7 +355,7 @@ public void ShouldUseSpecifiedSourceBranchesForDevelop()
355
355
source-branches: ['develop']
356
356
tag: dev" ;
357
357
SetupConfigFileContent ( text ) ;
358
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
358
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
359
359
360
360
configuration . Branches [ "develop" ] . SourceBranches . ShouldBe ( new List < string > { "develop" } ) ;
361
361
}
@@ -370,7 +370,7 @@ public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForDevelop()
370
370
mode: ContinuousDeployment
371
371
tag: dev" ;
372
372
SetupConfigFileContent ( text ) ;
373
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
373
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
374
374
375
375
configuration . Branches [ "develop" ] . SourceBranches . ShouldBe ( new List < string > ( ) ) ;
376
376
}
@@ -386,7 +386,7 @@ public void ShouldUseSpecifiedSourceBranchesForFeature()
386
386
source-branches: ['develop', 'release']
387
387
tag: dev" ;
388
388
SetupConfigFileContent ( text ) ;
389
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
389
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
390
390
391
391
configuration . Branches [ "feature" ] . SourceBranches . ShouldBe ( new List < string > { "develop" , "release" } ) ;
392
392
}
@@ -401,7 +401,7 @@ public void ShouldUseDefaultSourceBranchesWhenNotSpecifiedForFeature()
401
401
mode: ContinuousDeployment
402
402
tag: dev" ;
403
403
SetupConfigFileContent ( text ) ;
404
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
404
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
405
405
406
406
configuration . Branches [ "feature" ] . SourceBranches . ShouldBe (
407
407
new List < string > { "develop" , MainBranch , "release" , "feature" , "support" , "hotfix" } ) ;
@@ -415,8 +415,8 @@ public void ShouldNotOverrideAnythingWhenOverrideConfigIsEmpty()
415
415
tag-prefix: custom-tag-prefix-from-yml" ;
416
416
SetupConfigFileContent ( text ) ;
417
417
418
- var expectedConfig = this . configProvider . Provide ( this . repoPath ) ;
419
- var overridenConfig = this . configProvider . Provide ( this . repoPath , new GitVersionConfiguration ( ) ) ;
418
+ var expectedConfig = this . configurationProvider . Provide ( this . repoPath ) ;
419
+ var overridenConfig = this . configurationProvider . Provide ( this . repoPath , new GitVersionConfiguration ( ) ) ;
420
420
421
421
overridenConfig . AssemblyVersioningScheme . ShouldBe ( expectedConfig . AssemblyVersioningScheme ) ;
422
422
overridenConfig . AssemblyFileVersioningScheme . ShouldBe ( expectedConfig . AssemblyFileVersioningScheme ) ;
@@ -453,7 +453,7 @@ public void ShouldUseDefaultTagPrefixWhenNotSetInConfigFile()
453
453
{
454
454
const string text = "" ;
455
455
SetupConfigFileContent ( text ) ;
456
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
456
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
457
457
458
458
configuration . TagPrefix . ShouldBe ( "[vV]" ) ;
459
459
}
@@ -463,7 +463,7 @@ public void ShouldUseTagPrefixFromConfigFileWhenProvided()
463
463
{
464
464
const string text = "tag-prefix: custom-tag-prefix-from-yml" ;
465
465
SetupConfigFileContent ( text ) ;
466
- var configuration = this . configProvider . Provide ( this . repoPath ) ;
466
+ var configuration = this . configurationProvider . Provide ( this . repoPath ) ;
467
467
468
468
configuration . TagPrefix . ShouldBe ( "custom-tag-prefix-from-yml" ) ;
469
469
}
@@ -473,7 +473,7 @@ public void ShouldOverrideTagPrefixWithOverrideConfigValue([Values] bool tagPref
473
473
{
474
474
var text = tagPrefixSetAtYmlFile ? "tag-prefix: custom-tag-prefix-from-yml" : "" ;
475
475
SetupConfigFileContent ( text ) ;
476
- var configuration = this . configProvider . Provide ( this . repoPath , new GitVersionConfiguration { TagPrefix = "tag-prefix-from-override-configuration" } ) ;
476
+ var configuration = this . configurationProvider . Provide ( this . repoPath , new GitVersionConfiguration { TagPrefix = "tag-prefix-from-override-configuration" } ) ;
477
477
478
478
configuration . TagPrefix . ShouldBe ( "tag-prefix-from-override-configuration" ) ;
479
479
}
@@ -483,7 +483,7 @@ public void ShouldNotOverrideDefaultTagPrefixWhenNotSetInOverrideConfig()
483
483
{
484
484
const string text = "" ;
485
485
SetupConfigFileContent ( text ) ;
486
- var configuration = this . configProvider . Provide ( this . repoPath , new GitVersionConfiguration { TagPrefix = null } ) ;
486
+ var configuration = this . configurationProvider . Provide ( this . repoPath , new GitVersionConfiguration { TagPrefix = null } ) ;
487
487
488
488
configuration . TagPrefix . ShouldBe ( "[vV]" ) ;
489
489
}
@@ -493,7 +493,7 @@ public void ShouldNotOverrideTagPrefixFromConfigFileWhenNotSetInOverrideConfig()
493
493
{
494
494
const string text = "tag-prefix: custom-tag-prefix-from-yml" ;
495
495
SetupConfigFileContent ( text ) ;
496
- var configuration = this . configProvider . Provide ( this . repoPath , new GitVersionConfiguration { TagPrefix = null } ) ;
496
+ var configuration = this . configurationProvider . Provide ( this . repoPath , new GitVersionConfiguration { TagPrefix = null } ) ;
497
497
498
498
configuration . TagPrefix . ShouldBe ( "custom-tag-prefix-from-yml" ) ;
499
499
}
0 commit comments