Skip to content

Commit 4448cb5

Browse files
Vadim Hatsuraarturcic
Vadim Hatsura
authored andcommitted
add setup and teardown for drone tests to fix unit tests
1 parent bc76c3e commit 4448cb5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/GitVersionCore.Tests/BuildServers/DroneTests.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@ namespace GitVersionCore.Tests.BuildServers
88
[TestFixture]
99
public class DroneTests : TestBase
1010
{
11+
[SetUp]
12+
public void SetUp()
13+
{
14+
Environment.SetEnvironmentVariable("DRONE", "true");
15+
}
16+
17+
[TearDown]
18+
public void TearDown()
19+
{
20+
Environment.SetEnvironmentVariable("DRONE", null);
21+
}
22+
1123
[Test]
1224
public void CanApplyToCurrentContext_ShouldBeTrue_WhenEnvironmentVariableIsSet()
1325
{
1426
// Arrange
15-
Environment.SetEnvironmentVariable("DRONE", "true");
1627
var buildServer = new Drone();
1728

1829
// Act

0 commit comments

Comments
 (0)