12
12
using LibGit2Sharp ;
13
13
using GitVersionCore . Tests . Helpers ;
14
14
using GitVersion . Logging ;
15
+ using GitVersion . VersionCalculation ;
15
16
using Environment = System . Environment ;
16
17
17
18
namespace GitVersionCore . Tests
@@ -26,6 +27,8 @@ public class GitVersionExecutorTests : TestBase
26
27
private IConfigFileLocator configFileLocator ;
27
28
private IBuildServerResolver buildServerResolver ;
28
29
private IGitVersionCache gitVersionCache ;
30
+ private IMetaDataCalculator metaDataCalculator ;
31
+ private IGitVersionFinder gitVersionFinder ;
29
32
30
33
[ SetUp ]
31
34
public void SetUp ( )
@@ -36,12 +39,14 @@ public void SetUp()
36
39
configFileLocator = new DefaultConfigFileLocator ( fileSystem , log ) ;
37
40
buildServerResolver = new BuildServerResolver ( null , log ) ;
38
41
gitVersionCache = new GitVersionCache ( fileSystem , log ) ;
42
+ metaDataCalculator = new MetaDataCalculator ( ) ;
43
+ gitVersionFinder = new GitVersionFinder ( log , metaDataCalculator ) ;
39
44
}
40
45
41
46
[ Test ]
42
47
public void CacheKeySameAfterReNormalizing ( )
43
48
{
44
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
49
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
45
50
46
51
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
47
52
{
@@ -69,7 +74,7 @@ public void CacheKeySameAfterReNormalizing()
69
74
[ Description ( "LibGit2Sharp fails here when running under Mono" ) ]
70
75
public void CacheKeyForWorktree ( )
71
76
{
72
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
77
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
73
78
74
79
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
75
80
{
@@ -143,7 +148,7 @@ public void CacheFileExistsOnDisk()
143
148
log = new Log ( logAppender ) ;
144
149
145
150
gitVersionCache = new GitVersionCache ( fileSystem , log ) ;
146
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
151
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
147
152
148
153
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
149
154
{
@@ -192,7 +197,7 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn
192
197
CommitDate: 2015-11-10
193
198
" ;
194
199
195
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
200
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
196
201
197
202
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
198
203
{
@@ -230,7 +235,7 @@ public void CacheFileIsMissing()
230
235
log = new Log ( logAppender ) ;
231
236
gitVersionCache = new GitVersionCache ( fileSystem , log ) ;
232
237
233
- var executeCore = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
238
+ var executeCore = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
234
239
235
240
RepositoryScope ( executeCore ) ;
236
241
var logsMessages = stringBuilder . ToString ( ) ;
@@ -274,7 +279,7 @@ public void ConfigChangeInvalidatesCache()
274
279
CommitDate: 2015-11-10
275
280
" ;
276
281
277
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
282
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
278
283
279
284
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
280
285
{
@@ -327,7 +332,7 @@ public void NoCacheBypassesCache()
327
332
CommitDate: 2015-11-10
328
333
" ;
329
334
330
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
335
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
331
336
332
337
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
333
338
{
@@ -347,7 +352,7 @@ public void NoCacheBypassesCache()
347
352
[ Test ]
348
353
public void WorkingDirectoryWithoutGit ( )
349
354
{
350
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
355
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
351
356
352
357
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
353
358
{
@@ -363,7 +368,7 @@ public void WorkingDirectoryWithoutGit()
363
368
[ Description ( "LibGit2Sharp fails when running under Mono" ) ]
364
369
public void GetProjectRootDirectory_WorkingDirectoryWithWorktree ( )
365
370
{
366
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
371
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
367
372
368
373
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
369
374
{
@@ -395,7 +400,7 @@ public void GetProjectRootDirectory_WorkingDirectoryWithWorktree()
395
400
[ Test ]
396
401
public void GetProjectRootDirectory_NoWorktree ( )
397
402
{
398
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
403
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
399
404
400
405
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
401
406
{
@@ -416,7 +421,7 @@ public void GetProjectRootDirectory_NoWorktree()
416
421
[ Test ]
417
422
public void DynamicRepositoriesShouldNotErrorWithFailedToFindGitDirectory ( )
418
423
{
419
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
424
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
420
425
421
426
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
422
427
{
@@ -434,7 +439,7 @@ public void DynamicRepositoriesShouldNotErrorWithFailedToFindGitDirectory()
434
439
[ Test ]
435
440
public void GetDotGitDirectory_NoWorktree ( )
436
441
{
437
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
442
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
438
443
439
444
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
440
445
{
@@ -457,7 +462,7 @@ public void GetDotGitDirectory_NoWorktree()
457
462
[ Description ( "LibGit2Sharp fails when running under Mono" ) ]
458
463
public void GetDotGitDirectory_Worktree ( )
459
464
{
460
- var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache ) ;
465
+ var versionAndBranchFinder = new GitVersionCalculator ( fileSystem , log , configFileLocator , buildServerResolver , gitVersionCache , gitVersionFinder , metaDataCalculator ) ;
461
466
462
467
RepositoryScope ( versionAndBranchFinder , ( fixture , vv ) =>
463
468
{
0 commit comments