@@ -521,7 +521,7 @@ public void GetIdAsVersion_ReadsMajorMinorFromVersionTxt()
521521 this . WriteVersionFile ( "4.8" ) ;
522522 var firstCommit = this . Repo . Commits . First ( ) ;
523523
524- Version v1 = firstCommit . GetIdAsVersion ( ) ;
524+ Version v1 = this . GetIdAsVersion ( firstCommit ) ;
525525 Assert . Equal ( 4 , v1 . Major ) ;
526526 Assert . Equal ( 8 , v1 . Minor ) ;
527527 }
@@ -532,7 +532,7 @@ public void GetIdAsVersion_ReadsMajorMinorFromVersionTxtInSubdirectory()
532532 this . WriteVersionFile ( "4.8" , relativeDirectory : "foo/bar" ) ;
533533 var firstCommit = this . Repo . Commits . First ( ) ;
534534
535- Version v1 = firstCommit . GetIdAsVersion ( "foo/bar" ) ;
535+ Version v1 = this . GetIdAsVersion ( firstCommit , "foo/bar" ) ;
536536 Assert . Equal ( 4 , v1 . Major ) ;
537537 Assert . Equal ( 8 , v1 . Minor ) ;
538538 }
@@ -543,7 +543,7 @@ public void GetIdAsVersion_MissingVersionTxt()
543543 this . AddCommits ( ) ;
544544 var firstCommit = this . Repo . Commits . First ( ) ;
545545
546- Version v1 = firstCommit . GetIdAsVersion ( ) ;
546+ Version v1 = this . GetIdAsVersion ( firstCommit ) ;
547547 Assert . Equal ( 0 , v1 . Major ) ;
548548 Assert . Equal ( 0 , v1 . Minor ) ;
549549 }
@@ -555,7 +555,7 @@ public void GetIdAsVersion_VersionFileNeverCheckedIn_3Ints()
555555 var expectedVersion = new Version ( 1 , 1 , 0 ) ;
556556 var unstagedVersionData = VersionOptions . FromVersion ( expectedVersion ) ;
557557 string versionFilePath = VersionFile . SetVersion ( this . RepoPath , unstagedVersionData ) ;
558- Version actualVersion = this . Repo . GetIdAsVersion ( ) ;
558+ Version actualVersion = this . GetIdAsVersion ( ) ;
559559 Assert . Equal ( expectedVersion . Major , actualVersion . Major ) ;
560560 Assert . Equal ( expectedVersion . Minor , actualVersion . Minor ) ;
561561 Assert . Equal ( expectedVersion . Build , actualVersion . Build ) ;
@@ -572,7 +572,7 @@ public void GetIdAsVersion_VersionFileNeverCheckedIn_2Ints()
572572 var expectedVersion = new Version ( 1 , 1 ) ;
573573 var unstagedVersionData = VersionOptions . FromVersion ( expectedVersion ) ;
574574 string versionFilePath = VersionFile . SetVersion ( this . RepoPath , unstagedVersionData ) ;
575- Version actualVersion = this . Repo . GetIdAsVersion ( ) ;
575+ Version actualVersion = this . GetIdAsVersion ( ) ;
576576 Assert . Equal ( expectedVersion . Major , actualVersion . Major ) ;
577577 Assert . Equal ( expectedVersion . Minor , actualVersion . Minor ) ;
578578 Assert . Equal ( 0 , actualVersion . Build ) ; // height is 0 since the change hasn't been committed.
@@ -587,7 +587,7 @@ public void GetIdAsVersion_VersionFileChangedOnDisk()
587587 this . AddCommits ( ) ;
588588
589589 // Verify that we're seeing the original version.
590- Version actualVersion = this . Repo . GetIdAsVersion ( ) ;
590+ Version actualVersion = this . GetIdAsVersion ( ) ;
591591 Assert . Equal ( 1 , actualVersion . Major ) ;
592592 Assert . Equal ( 2 , actualVersion . Minor ) ;
593593 Assert . Equal ( 2 , actualVersion . Build ) ;
@@ -597,15 +597,15 @@ public void GetIdAsVersion_VersionFileChangedOnDisk()
597597 string versionFile = VersionFile . SetVersion ( this . RepoPath , new Version ( "1.3" ) ) ;
598598
599599 // Verify that HEAD reports whatever is on disk at the time.
600- actualVersion = this . Repo . GetIdAsVersion ( ) ;
600+ actualVersion = this . GetIdAsVersion ( ) ;
601601 Assert . Equal ( 1 , actualVersion . Major ) ;
602602 Assert . Equal ( 3 , actualVersion . Minor ) ;
603603 Assert . Equal ( 0 , actualVersion . Build ) ;
604604 Assert . Equal ( this . Repo . Head . Commits . First ( ) . GetTruncatedCommitIdAsUInt16 ( ) , actualVersion . Revision ) ;
605605
606606 // Now commit it and verify the height advances 0->1
607607 this . CommitVersionFile ( versionFile , "1.3" ) ;
608- actualVersion = this . Repo . GetIdAsVersion ( ) ;
608+ actualVersion = this . GetIdAsVersion ( ) ;
609609 Assert . Equal ( 1 , actualVersion . Major ) ;
610610 Assert . Equal ( 3 , actualVersion . Minor ) ;
611611 Assert . Equal ( 1 , actualVersion . Build ) ;
@@ -650,7 +650,7 @@ public void GetIdAsVersion_Roundtrip(string version, string assemblyVersion, int
650650 for ( int i = 0 ; i < commits . Length ; i ++ )
651651 {
652652 commits [ i ] = this . Repo . Commit ( $ "Commit { i + 1 } ", this . Signer , this . Signer , new CommitOptions { AllowEmptyCommit = true } ) ;
653- versions [ i ] = commits [ i ] . GetIdAsVersion ( repoRelativeSubDirectory ) ;
653+ versions [ i ] = this . GetIdAsVersion ( commits [ i ] , repoRelativeSubDirectory ) ;
654654 this . Logger . WriteLine ( $ "Commit { commits [ i ] . Id . Sha . Substring ( 0 , 8 ) } as version: { versions [ i ] } ") ;
655655 }
656656
@@ -689,10 +689,10 @@ public void GetIdAsVersion_Roundtrip_UnstableOffset(int startingOffset, int offs
689689 {
690690 versionOptions . VersionHeightOffset += offsetStepChange ;
691691 commits [ i ] = this . WriteVersionFile ( versionOptions ) ;
692- versions [ i ] = commits [ i ] . GetIdAsVersion ( ) ;
692+ versions [ i ] = this . GetIdAsVersion ( commits [ i ] ) ;
693693
694694 commits [ i + 1 ] = this . Repo . Commit ( $ "Commit { i + 1 } ", this . Signer , this . Signer , new CommitOptions { AllowEmptyCommit = true } ) ;
695- versions [ i + 1 ] = commits [ i + 1 ] . GetIdAsVersion ( ) ;
695+ versions [ i + 1 ] = this . GetIdAsVersion ( commits [ i + 1 ] ) ;
696696
697697 this . Logger . WriteLine ( $ "Commit { commits [ i ] . Id . Sha . Substring ( 0 , 8 ) } as version: { versions [ i ] } ") ;
698698 this . Logger . WriteLine ( $ "Commit { commits [ i + 1 ] . Id . Sha . Substring ( 0 , 8 ) } as version: { versions [ i + 1 ] } ") ;
@@ -731,8 +731,8 @@ public void GetIdAsVersion_Roundtrip_WithSubdirectoryVersionFiles()
731731 this . InitializeSourceControl ( ) ;
732732
733733 Commit head = this . Repo . Head . Commits . First ( ) ;
734- Version rootVersionActual = head . GetIdAsVersion ( ) ;
735- Version subPathVersionActual = head . GetIdAsVersion ( subPathRelative ) ;
734+ Version rootVersionActual = this . GetIdAsVersion ( head ) ;
735+ Version subPathVersionActual = this . GetIdAsVersion ( head , subPathRelative ) ;
736736
737737 // Verify that the versions calculated took the path into account.
738738 Assert . Equal ( rootVersionExpected . Version . Version . Minor , rootVersionActual ? . Minor ) ;
@@ -753,7 +753,7 @@ public void GetIdAsVersion_FitsInsideCompilerConstraints()
753753 this . WriteVersionFile ( "2.5" ) ;
754754 var firstCommit = this . Repo . Commits . First ( ) ;
755755
756- Version version = firstCommit . GetIdAsVersion ( ) ;
756+ Version version = this . GetIdAsVersion ( firstCommit ) ;
757757 this . Logger . WriteLine ( version . ToString ( ) ) ;
758758
759759 // The C# compiler produces a build warning and truncates the version number if it exceeds 0xfffe,
@@ -772,12 +772,12 @@ public void GetIdAsVersion_MigrationFromVersionTxtToJson()
772772 var jsonCommit = this . WriteVersionFile ( "4.8" ) ;
773773 Assert . True ( File . Exists ( Path . Combine ( this . RepoPath , "version.json" ) ) ) ;
774774
775- Version v1 = txtCommit . GetIdAsVersion ( ) ;
775+ Version v1 = this . GetIdAsVersion ( txtCommit ) ;
776776 Assert . Equal ( 4 , v1 . Major ) ;
777777 Assert . Equal ( 8 , v1 . Minor ) ;
778778 Assert . Equal ( 1 , v1 . Build ) ;
779779
780- Version v2 = jsonCommit . GetIdAsVersion ( ) ;
780+ Version v2 = this . GetIdAsVersion ( jsonCommit ) ;
781781 Assert . Equal ( 4 , v2 . Major ) ;
782782 Assert . Equal ( 8 , v2 . Minor ) ;
783783 Assert . Equal ( 2 , v2 . Build ) ;
@@ -793,7 +793,7 @@ public void TestBiggerRepo()
793793 {
794794 foreach ( var commit in this . Repo . Head . Commits )
795795 {
796- var version = commit . GetIdAsVersion ( "src" ) ;
796+ var version = this . GetIdAsVersion ( commit , "src" ) ;
797797 this . Logger . WriteLine ( $ "commit { commit . Id } got version { version } ") ;
798798 var backAgain = this . Repo . GetCommitFromVersion ( version , "src" ) ;
799799 Assert . Equal ( commit , backAgain ) ;
@@ -820,7 +820,7 @@ private void VerifyCommitsWithVersion(Commit[] commits)
820820
821821 for ( int i = 0 ; i < commits . Length ; i ++ )
822822 {
823- Version encodedVersion = commits [ i ] . GetIdAsVersion ( ) ;
823+ Version encodedVersion = this . GetIdAsVersion ( commits [ i ] ) ;
824824 Assert . Equal ( i + 1 , encodedVersion . Build ) ;
825825 Assert . Equal ( commits [ i ] , this . Repo . GetCommitFromVersion ( encodedVersion ) ) ;
826826 }
0 commit comments