Skip to content

Commit

Permalink
TEMP COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed May 2, 2024
1 parent f37c201 commit 9527066
Show file tree
Hide file tree
Showing 5 changed files with 384 additions and 381 deletions.
72 changes: 57 additions & 15 deletions Source/Cake.Codecov.Tests/CodecovRunnerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Runtime.InteropServices;
using Cake.Codecov.Internals;
using Cake.Codecov.Tests.Attributes;
using Cake.Core;
Expand Down Expand Up @@ -107,6 +108,7 @@ public void Should_Find_Codecov_Runner_If_Tool_Path_Not_Provided_On_Windows()

[Theory]
[InlineData("linux-x64/codecov")]
[InlineData("codecov-linux")]
[InlineData("codecov")]
public void Should_Find_Codecov_Runner_If_Tool_Path_Not_Provided_On_Linux(string path)
{
Expand All @@ -129,6 +131,7 @@ public void Should_Find_Codecov_Runner_If_Tool_Path_Not_Provided_On_Linux(string

[Theory]
[InlineData("linux-x64/codecov")]
[InlineData("codecov-macos")]
[InlineData("codecov")]
public void Should_Find_Codecov_Runner_If_Tool_Path_Not_Provided_On_osx(string path)
{
Expand Down Expand Up @@ -229,8 +232,8 @@ public void Should_Set_Commit()
result.Args.Should().Be(@"--sha ""603e02d40093d0649cfa787d846ae4ccc038085c""");
}

[Fact]
public void Should_Enable_DisableNetwork()
[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Enable_DryRun_When_DisableNetwork_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { DisableNetwork = true } };
Expand All @@ -239,11 +242,11 @@ public void Should_Enable_DisableNetwork()
var result = fixture.Run();

// Then
result.Args.Should().Be("--disable-network");
result.Args.Should().Be("--dryRun");
}

[Fact]
public void Should_Enable_Dump()
[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Enable_DryRun_When_Dump_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { Dump = true } };
Expand All @@ -252,7 +255,20 @@ public void Should_Enable_Dump()
var result = fixture.Run();

// Then
result.Args.Should().Be("--dump");
result.Args.Should().Be("--dryRun");
}

[Fact]
public void Should_Enable_DryRun()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { DryRun = true } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be("--dryRun");
}

[Fact]
Expand Down Expand Up @@ -316,12 +332,12 @@ public void Should_Set_Name()
// When
var result = fixture.Run();

// Then
// ThenRæ
result.Args.Should().Be(@"--name ""custom name""");
}

[Fact]
public void Should_Enable_NoColor()
[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Ignore_NoColor()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { NoColor = true } };
Expand All @@ -330,7 +346,7 @@ public void Should_Enable_NoColor()
var result = fixture.Run();

// Then
result.Args.Should().Be("--no-color");
result.Args.Should().BeNullOrEmpty();
}

[Fact]
Expand All @@ -346,8 +362,8 @@ public void Should_Set_Pr()
result.Args.Should().Be(@"--pr ""1""");
}

[Fact]
public void Should_Enable_Required()
[Fact, Obsolete("Remove in v2.0.0")]
public void Should_Enable_NonZero_When_Required_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { Required = true } };
Expand All @@ -356,11 +372,24 @@ public void Should_Enable_Required()
var result = fixture.Run();

// Then
result.Args.Should().Be("--required");
result.Args.Should().Be("--nonZero");
}

[Fact]
public void Should_Set_Root()
public void Should_Enable_NonZero()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { NonZero = true } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be("--nonZero");
}

[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Set_RootDirectory_When_Root_Is_Set()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { Root = @".\working" } };
Expand All @@ -369,7 +398,20 @@ public void Should_Set_Root()
var result = fixture.Run();

// Then
result.Args.Should().Be(@"--root ""working""");
result.Args.Should().Be(@"--rootDir ""working""");
}

[Fact]
public void Should_Set_RootDirectory()
{
// Given
var fixture = new CodecovRunnerFixture { Settings = { RootDirectory = @".\working" } };

// When
var result = fixture.Run();

// Then
result.Args.Should().Be(@"--rootDir ""working""");
}

[Fact]
Expand Down
6 changes: 3 additions & 3 deletions Source/Cake.Codecov.Tests/CodecovSettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public void Should_Set_Name_Value()
settings.Name.Should().Be(expected);
}

[Fact]
public void Should_Set_NoColor_Value()
[Fact, Obsolete("Remove test in v2.0.0")]
public void Should_Not_Set_NoColor_Value()
{
// Given
var settings = new CodecovSettings
Expand All @@ -185,7 +185,7 @@ public void Should_Set_NoColor_Value()
};

// Then
settings.NoColor.Should().BeTrue();
settings.NoColor.Should().BeFalse();
}

[Fact]
Expand Down

0 comments on commit 9527066

Please sign in to comment.