Skip to content

Commit ae186ca

Browse files
committed
Fixed some broken tests
1 parent aaa30df commit ae186ca

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/GitVersionCore.Tests/GitToolsTestingExtensions.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ public static Config ApplyDefaults(this Config config)
1515
return config;
1616
}
1717

18-
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true)
18+
public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, Config configuration = null, IRepository repository = null, string commitId = null, bool isForTrackedBranchOnly = true)
1919
{
20-
ConfigurationProvider.ApplyDefaultsTo(configuration);
20+
if (configuration == null)
21+
{
22+
configuration = new Config();
23+
ConfigurationProvider.ApplyDefaultsTo(configuration);
24+
}
2125
var gitVersionContext = new GitVersionContext(repository ?? fixture.Repository, configuration, isForTrackedBranchOnly, commitId);
2226
var executeGitVersion = ExecuteGitVersion(gitVersionContext);
2327
var variables = VariableProvider.GetVariablesFor(executeGitVersion, gitVersionContext.Configuration, gitVersionContext.IsCurrentCommitTagged);
@@ -55,7 +59,7 @@ public static void AssertFullSemver(this RepositoryFixtureBase fixture, Config c
5559
}
5660
if (commitId == null)
5761
{
58-
fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3");
62+
fixture.SequenceDiagram.NoteOver(fullSemver, fixture.Repository.Head.FriendlyName, color: "#D3D3D3");
5963
}
6064
}
6165

src/GitVersionCore.Tests/IntegrationTests/DocumentationSamples.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public void GitHubFlowMajorRelease()
395395
fixture.AssertFullSemver("2.0.0-beta.1");
396396

397397
// test that the CommitsSinceVersionSource should still return commit count
398-
var version = fixture.GetVersion(new Config());
398+
var version = fixture.GetVersion();
399399
version.CommitsSinceVersionSource.ShouldBe("2");
400400

401401
// Make a commit after a tag should bump up the beta

0 commit comments

Comments
 (0)