Skip to content

Commit 41211b0

Browse files
committed
RepositoryFixtureBase was not using the variable provider making it effectively ignore the mode config. Now it does
1 parent 2fdfc7e commit 41211b0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

GitVersionCore.Tests/Fixtures/RepositoryFixtureBase.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@ protected RepositoryFixtureBase(Func<string, IRepository> repoBuilder, Config co
2121

2222
public bool IsForTrackedBranchOnly { private get; set; }
2323

24-
public SemanticVersion ExecuteGitVersion(IRepository repository = null)
24+
public void AssertFullSemver(string fullSemver, IRepository repository = null)
2525
{
26-
var vf = new GitVersionFinder();
27-
return vf.FindVersion(new GitVersionContext(repository ?? Repository, configuration, IsForTrackedBranchOnly));
26+
var gitVersionContext = new GitVersionContext(repository ?? Repository, configuration, IsForTrackedBranchOnly);
27+
var executeGitVersion = ExecuteGitVersion(gitVersionContext);
28+
var variables = VariableProvider.GetVariablesFor(executeGitVersion,
29+
gitVersionContext.Configuration.AssemblyVersioningScheme,
30+
gitVersionContext.Configuration.VersioningMode,
31+
gitVersionContext.Configuration.ContinuousDeploymentFallbackTag,
32+
gitVersionContext.IsCurrentCommitTagged);
33+
variables.FullSemVer.ShouldBe(fullSemver);
2834
}
2935

30-
public void AssertFullSemver(string fullSemver, IRepository repository = null)
36+
private SemanticVersion ExecuteGitVersion(GitVersionContext context)
3137
{
32-
ExecuteGitVersion(repository).ToString("f").ShouldBe(fullSemver);
38+
var vf = new GitVersionFinder();
39+
return vf.FindVersion(context);
3340
}
3441

3542
public virtual void Dispose()

0 commit comments

Comments
 (0)