mirror of
https://github.com/actions/runner.git
synced 2025-12-13 10:05:23 +00:00
Fix build warnings in Test project (#178)
The build warnings were of these type (mostly reported by xUnit's Code Analyzers): - Fixed wrong parameter order in xUnit assertions (can lead to poor error reporting in test failures) - Unused code was removed - Correct assertions were used (e.g. Assert.True/.Contains/.EndsWith) - Public non-test methods on test classes were made private
This commit is contained in:
committed by
Thomas Boop
parent
bcac4557a0
commit
ec9cb6c68d
@@ -31,7 +31,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
private TestHostContext _hc;
|
||||
private ActionRunner _actionRunner;
|
||||
private IActionManifestManager _actionManifestManager;
|
||||
private string _workFolder;
|
||||
private DictionaryContextData _context = new DictionaryContextData();
|
||||
|
||||
[Fact]
|
||||
@@ -75,9 +74,9 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
}
|
||||
|
||||
//Assert
|
||||
Assert.Equal(finialInputs["input1"], "test1");
|
||||
Assert.Equal(finialInputs["input2"], "test2");
|
||||
Assert.Equal(finialInputs["input3"], "github");
|
||||
Assert.Equal("test1", finialInputs["input1"]);
|
||||
Assert.Equal("test2", finialInputs["input2"]);
|
||||
Assert.Equal("github", finialInputs["input3"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -278,24 +277,6 @@ namespace GitHub.Runner.Common.Tests.Worker
|
||||
Assert.Equal("${{ matrix.node }}", _actionRunner.DisplayName);
|
||||
}
|
||||
|
||||
private void CreateAction(string yamlContent, out Pipelines.ActionStep instance, out string directory)
|
||||
{
|
||||
directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "master");
|
||||
string file = Path.Combine(directory, Constants.Path.ActionManifestFile);
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(file));
|
||||
File.WriteAllText(file, yamlContent);
|
||||
instance = new Pipelines.ActionStep()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Reference = new Pipelines.RepositoryPathReference()
|
||||
{
|
||||
Name = "GitHub/actions",
|
||||
Ref = "master",
|
||||
RepositoryType = Pipelines.RepositoryTypes.GitHub
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void Setup([CallerMemberName] string name = "")
|
||||
{
|
||||
_ecTokenSource?.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user