@@ -313,7 +313,9 @@ public void ChoosesHighestVersionReturnedFromStrategies()
313
313
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
314
314
var dateTimeOffset = DateTimeOffset . Now ;
315
315
var versionStrategies = new IVersionStrategy [ ] { new V1Strategy ( DateTimeOffset . Now ) , new V2Strategy ( dateTimeOffset ) } ;
316
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
316
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
317
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
318
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
317
319
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
318
320
319
321
// Act
@@ -342,7 +344,9 @@ public void UsesWhenFromNextBestMatchIfHighestDoesntHaveWhen()
342
344
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
343
345
var when = DateTimeOffset . Now ;
344
346
var versionStrategies = new IVersionStrategy [ ] { new V1Strategy ( when ) , new V2Strategy ( null ) } ;
345
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
347
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
348
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
349
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
346
350
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
347
351
348
352
// Act
@@ -371,7 +375,9 @@ public void UsesWhenFromNextBestMatchIfHighestDoesntHaveWhenReversedOrder()
371
375
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
372
376
var when = DateTimeOffset . Now ;
373
377
var versionStrategies = new IVersionStrategy [ ] { new V2Strategy ( null ) , new V1Strategy ( when ) } ;
374
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
378
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
379
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
380
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
375
381
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
376
382
377
383
// Act
@@ -401,7 +407,9 @@ public void ShouldNotFilterVersion()
401
407
repositoryStoreMock . GetSourceBranches ( branchMock , configuration , Arg . Any < HashSet < IBranch > > ( ) ) . Returns ( Enumerable . Empty < IBranch > ( ) ) ;
402
408
var version = new BaseVersion ( "dummy" , false , new SemanticVersion ( 2 ) , GitToolsTestingExtensions . CreateMockCommit ( ) , null ) ;
403
409
var versionStrategies = new IVersionStrategy [ ] { new TestVersionStrategy ( version ) } ;
404
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
410
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
411
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
412
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
405
413
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
406
414
407
415
// Act
@@ -431,7 +439,9 @@ public void ShouldFilterVersion()
431
439
var higherVersion = new BaseVersion ( "exclude" , false , new SemanticVersion ( 2 ) , GitToolsTestingExtensions . CreateMockCommit ( ) , null ) ;
432
440
var lowerVersion = new BaseVersion ( "dummy" , false , new SemanticVersion ( 1 ) , GitToolsTestingExtensions . CreateMockCommit ( ) , null ) ;
433
441
var versionStrategies = new IVersionStrategy [ ] { new TestVersionStrategy ( higherVersion , lowerVersion ) } ;
434
- var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , Substitute . For < IMainlineVersionCalculator > ( ) ,
442
+ var mainlineVersionCalculatorMock = Substitute . For < IMainlineVersionCalculator > ( ) ;
443
+ mainlineVersionCalculatorMock . CreateVersionBuildMetaData ( Arg . Any < ICommit ? > ( ) ) . Returns ( new SemanticVersionBuildMetaData ( ) ) ;
444
+ var unitUnderTest = new NextVersionCalculator ( Substitute . For < ILog > ( ) , mainlineVersionCalculatorMock ,
435
445
repositoryStoreMock , new ( context ) , versionStrategies , effectiveBranchConfigurationFinderMock , incrementStrategyFinderMock ) ;
436
446
437
447
// Act
0 commit comments