@@ -19,7 +19,7 @@ namespace GitVersionCore.Tests
19
19
{
20
20
[ TestFixture ]
21
21
[ Parallelizable ( ParallelScope . None ) ]
22
- public class ExecuteCoreTests : TestBase
22
+ public class GitVersionExecutorTests : TestBase
23
23
{
24
24
private IFileSystem fileSystem ;
25
25
private IEnvironment environment ;
@@ -40,7 +40,7 @@ public void SetUp()
40
40
[ Test ]
41
41
public void CacheKeySameAfterReNormalizing ( )
42
42
{
43
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
43
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
44
44
45
45
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
46
46
{
@@ -62,7 +62,7 @@ public void CacheKeySameAfterReNormalizing()
62
62
[ Description ( "LibGit2Sharp fails here when running under Mono" ) ]
63
63
public void CacheKeyForWorktree ( )
64
64
{
65
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
65
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
66
66
67
67
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
68
68
{
@@ -128,12 +128,12 @@ public void CacheFileExistsOnDisk()
128
128
var logAppender = new TestLogAppender ( Action ) ;
129
129
log = new Log ( logAppender ) ;
130
130
131
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
131
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
132
132
133
133
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
134
134
{
135
135
fileSystem . WriteAllText ( vv . FileName , versionCacheFileContent ) ;
136
- vv = versionAndBranchFinder . ExecuteGitVersion ( new Arguments { TargetPath = fixture . RepositoryPath } ) ;
136
+ vv = versionAndBranchFinder . ComputeVersionVariables ( new Arguments { TargetPath = fixture . RepositoryPath } ) ;
137
137
vv . AssemblySemVer . ShouldBe ( "4.10.3.0" ) ;
138
138
} ) ;
139
139
@@ -177,7 +177,7 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn
177
177
CommitDate: 2015-11-10
178
178
" ;
179
179
180
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
180
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
181
181
182
182
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
183
183
{
@@ -188,7 +188,7 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn
188
188
189
189
var cacheDirectoryTimestamp = fileSystem . GetLastDirectoryWrite ( cacheDirectory ) ;
190
190
191
- vv = versionAndBranchFinder . ExecuteGitVersion ( new Arguments { TargetPath = fixture . RepositoryPath , OverrideConfig = new Config { TagPrefix = "prefix" } } ) ;
191
+ vv = versionAndBranchFinder . ComputeVersionVariables ( new Arguments { TargetPath = fixture . RepositoryPath , OverrideConfig = new Config { TagPrefix = "prefix" } } ) ;
192
192
193
193
vv . AssemblySemVer . ShouldBe ( "0.1.0.0" ) ;
194
194
@@ -208,7 +208,7 @@ public void CacheFileIsMissing()
208
208
var logAppender = new TestLogAppender ( Action ) ;
209
209
log = new Log ( logAppender ) ;
210
210
211
- var executeCore = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
211
+ var executeCore = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
212
212
213
213
RepositoryScope ( executeCore ) ;
214
214
var logsMessages = stringBuilder . ToString ( ) ;
@@ -252,19 +252,19 @@ public void ConfigChangeInvalidatesCache()
252
252
CommitDate: 2015-11-10
253
253
" ;
254
254
255
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
255
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
256
256
257
257
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
258
258
{
259
259
fileSystem . WriteAllText ( vv . FileName , versionCacheFileContent ) ;
260
260
var arguments = new Arguments { TargetPath = fixture . RepositoryPath } ;
261
- vv = versionAndBranchFinder . ExecuteGitVersion ( arguments ) ;
261
+ vv = versionAndBranchFinder . ComputeVersionVariables ( arguments ) ;
262
262
vv . AssemblySemVer . ShouldBe ( "4.10.3.0" ) ;
263
263
264
264
var configPath = Path . Combine ( fixture . RepositoryPath , "GitVersionConfig.yaml" ) ;
265
265
fileSystem . WriteAllText ( configPath , "next-version: 5.0" ) ;
266
266
267
- vv = versionAndBranchFinder . ExecuteGitVersion ( arguments ) ;
267
+ vv = versionAndBranchFinder . ComputeVersionVariables ( arguments ) ;
268
268
vv . AssemblySemVer . ShouldBe ( "5.0.0.0" ) ;
269
269
} ) ;
270
270
}
@@ -305,18 +305,18 @@ public void NoCacheBypassesCache()
305
305
CommitDate: 2015-11-10
306
306
" ;
307
307
308
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
308
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
309
309
310
310
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
311
311
{
312
312
var arguments = new Arguments { TargetPath = fixture . RepositoryPath } ;
313
313
314
314
fileSystem . WriteAllText ( vv . FileName , versionCacheFileContent ) ;
315
- vv = versionAndBranchFinder . ExecuteGitVersion ( arguments ) ;
315
+ vv = versionAndBranchFinder . ComputeVersionVariables ( arguments ) ;
316
316
vv . AssemblySemVer . ShouldBe ( "4.10.3.0" ) ;
317
317
318
318
arguments . NoCache = true ;
319
- vv = versionAndBranchFinder . ExecuteGitVersion ( arguments ) ;
319
+ vv = versionAndBranchFinder . ComputeVersionVariables ( arguments ) ;
320
320
vv . AssemblySemVer . ShouldBe ( "0.1.0.0" ) ;
321
321
} ) ;
322
322
}
@@ -325,13 +325,13 @@ public void NoCacheBypassesCache()
325
325
[ Test ]
326
326
public void WorkingDirectoryWithoutGit ( )
327
327
{
328
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
328
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
329
329
330
330
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
331
331
{
332
332
var arguments = new Arguments { TargetPath = Environment . SystemDirectory } ;
333
333
334
- var exception = Assert . Throws < DirectoryNotFoundException > ( ( ) => versionAndBranchFinder . ExecuteGitVersion ( arguments ) ) ;
334
+ var exception = Assert . Throws < DirectoryNotFoundException > ( ( ) => versionAndBranchFinder . ComputeVersionVariables ( arguments ) ) ;
335
335
exception . Message . ShouldContain ( "Can't find the .git directory in" ) ;
336
336
} ) ;
337
337
}
@@ -341,7 +341,7 @@ public void WorkingDirectoryWithoutGit()
341
341
[ Description ( "LibGit2Sharp fails when running under Mono" ) ]
342
342
public void GetProjectRootDirectory_WorkingDirectoryWithWorktree ( )
343
343
{
344
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
344
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
345
345
346
346
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
347
347
{
@@ -366,7 +366,7 @@ public void GetProjectRootDirectory_WorkingDirectoryWithWorktree()
366
366
[ Test ]
367
367
public void GetProjectRootDirectory_NoWorktree ( )
368
368
{
369
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
369
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
370
370
371
371
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
372
372
{
@@ -380,7 +380,7 @@ public void GetProjectRootDirectory_NoWorktree()
380
380
[ Test ]
381
381
public void DynamicRepositoriesShouldNotErrorWithFailedToFindGitDirectory ( )
382
382
{
383
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
383
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
384
384
385
385
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
386
386
{
@@ -391,14 +391,14 @@ public void DynamicRepositoriesShouldNotErrorWithFailedToFindGitDirectory()
391
391
TargetBranch = "refs/head/master"
392
392
} ;
393
393
394
- versionAndBranchFinder . ExecuteGitVersion ( arguments ) ;
394
+ versionAndBranchFinder . ComputeVersionVariables ( arguments ) ;
395
395
} ) ;
396
396
}
397
397
398
398
[ Test ]
399
399
public void GetDotGitDirectory_NoWorktree ( )
400
400
{
401
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
401
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
402
402
403
403
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
404
404
{
@@ -414,7 +414,7 @@ public void GetDotGitDirectory_NoWorktree()
414
414
[ Description ( "LibGit2Sharp fails when running under Mono" ) ]
415
415
public void GetDotGitDirectory_Worktree ( )
416
416
{
417
- var versionAndBranchFinder = new ExecuteCore ( fileSystem , log , configFileLocator , buildServerResolver ) ;
417
+ var versionAndBranchFinder = new GitVersionComputer ( fileSystem , log , configFileLocator , buildServerResolver ) ;
418
418
419
419
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
420
420
{
@@ -438,7 +438,7 @@ public void GetDotGitDirectory_Worktree()
438
438
} ) ;
439
439
}
440
440
441
- private void RepositoryScope ( ExecuteCore executeCore , Action < EmptyRepositoryFixture , VersionVariables > fixtureAction = null )
441
+ private void RepositoryScope ( GitVersionComputer gitVersionComputer , Action < EmptyRepositoryFixture , VersionVariables > fixtureAction = null )
442
442
{
443
443
// Make sure GitVersion doesn't trigger build server mode when we are running the tests
444
444
environment . SetEnvironmentVariable ( AppVeyor . EnvironmentVariableName , null ) ;
@@ -449,7 +449,7 @@ private void RepositoryScope(ExecuteCore executeCore, Action<EmptyRepositoryFixt
449
449
using var fixture = new EmptyRepositoryFixture ( ) ;
450
450
var arguments = new Arguments { TargetPath = fixture . RepositoryPath } ;
451
451
fixture . Repository . MakeACommit ( ) ;
452
- var vv = executeCore . ExecuteGitVersion ( arguments ) ;
452
+ var vv = gitVersionComputer . ComputeVersionVariables ( arguments ) ;
453
453
454
454
vv . AssemblySemVer . ShouldBe ( "0.1.0.0" ) ;
455
455
vv . FileName . ShouldNotBeNullOrEmpty ( ) ;
0 commit comments