Skip to content

Commit 3a2d75c

Browse files
committed
Unit Tests for Issue #728
Adding unit tests to MasterScenarios for verifying expected behaviour for continuous deployment and continuous delivery scenarios.
1 parent 1f49eff commit 3a2d75c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

src/GitVersionCore.Tests/IntegrationTests/MasterScenarios.cs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,52 @@
55
[TestFixture]
66
public class MasterScenarios
77
{
8+
[Test]
9+
public void CanHandleContinuousDelivery()
10+
{
11+
var config = new Config
12+
{
13+
Branches =
14+
{
15+
{
16+
"master", new BranchConfig
17+
{
18+
VersioningMode = VersioningMode.ContinuousDelivery
19+
}
20+
}
21+
}
22+
};
23+
using(var fixture = new EmptyRepositoryFixture(config))
24+
{
25+
fixture.Repository.MakeATaggedCommit("1.0.0");
26+
fixture.Repository.MakeCommits(2);
27+
fixture.AssertFullSemver("1.0.1+2");
28+
}
29+
}
30+
31+
[Test]
32+
public void CanHandleContinuousDeployment()
33+
{
34+
var config = new Config
35+
{
36+
Branches =
37+
{
38+
{
39+
"master", new BranchConfig
40+
{
41+
VersioningMode = VersioningMode.ContinuousDeployment
42+
}
43+
}
44+
}
45+
};
46+
using(var fixture = new EmptyRepositoryFixture(config))
47+
{
48+
fixture.Repository.MakeATaggedCommit("1.0.0");
49+
fixture.Repository.MakeCommits(2);
50+
fixture.AssertFullSemver("1.0.1-ci.2");
51+
}
52+
}
53+
854
[Test]
955
public void GivenARepositoryWithCommitsButNoTags_VersionShouldBe_0_1()
1056
{

0 commit comments

Comments
 (0)