@@ -309,7 +309,9 @@ public void ChoosesHighestVersionReturnedFromStrategies()
309
309
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
310
310
var dateTimeOffset = DateTimeOffset . Now ;
311
311
var versionStrategies = new IVersionStrategy [ ] { new V1Strategy ( DateTimeOffset . Now ) , new V2Strategy ( dateTimeOffset ) } ;
312
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
312
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
313
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
314
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
313
315
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
314
316
315
317
// Act
@@ -338,7 +340,9 @@ public void UsesWhenFromNextBestMatchIfHighestDoesntHaveWhen()
338
340
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
339
341
var when = DateTimeOffset . Now ;
340
342
var versionStrategies = new IVersionStrategy [ ] { new V1Strategy ( when ) , new V2Strategy ( null ) } ;
341
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
343
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
344
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
345
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
342
346
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
343
347
344
348
// Act
@@ -367,7 +371,9 @@ public void UsesWhenFromNextBestMatchIfHighestDoesntHaveWhenReversedOrder()
367
371
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
368
372
var when = DateTimeOffset . Now ;
369
373
var versionStrategies = new IVersionStrategy [ ] { new V2Strategy ( null ) , new V1Strategy ( when ) } ;
370
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
374
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
375
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
376
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
371
377
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
372
378
373
379
// Act
@@ -397,7 +403,9 @@ public void ShouldNotFilterVersion()
397
403
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
398
404
var version = new BaseVersion ( "dummy" , false , new SemanticVersion ( 2 ) , GitToolsTestingExtensions . CreateMockCommit ( ) , null ) ;
399
405
var versionStrategies = new IVersionStrategy [ ] { new TestVersionStrategy ( version ) } ;
400
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
406
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
407
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
408
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
401
409
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
402
410
403
411
// Act
@@ -427,7 +435,9 @@ public void ShouldFilterVersion()
427
435
var higherVersion = new BaseVersion ( "exclude" , false , new SemanticVersion ( 2 ) , GitToolsTestingExtensions . CreateMockCommit ( ) , null ) ;
428
436
var lowerVersion = new BaseVersion ( "dummy" , false , new SemanticVersion ( 1 ) , GitToolsTestingExtensions . CreateMockCommit ( ) , null ) ;
429
437
var versionStrategies = new IVersionStrategy [ ] { new TestVersionStrategy ( higherVersion , lowerVersion ) } ;
430
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
438
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
439
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
440
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
431
441
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
432
442
433
443
// Act
0 commit comments