Skip to content

Commit 8c4fda5

Browse files
committed
code cleanup
1 parent d61823b commit 8c4fda5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+67
-67
lines changed

src/GitVersionCore.Tests/BuildServers/AzurePipelinesBuildNumberTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ namespace GitVersionCore.Tests.BuildServers
99
[TestFixture]
1010
public class AzurePipelinesBuildNumberTests : TestBase
1111
{
12-
private string key = "BUILD_BUILDNUMBER";
13-
private string logPrefix = "##vso[build.updatebuildnumber]";
12+
private readonly string key = "BUILD_BUILDNUMBER";
13+
private readonly string logPrefix = "##vso[build.updatebuildnumber]";
1414
private AzurePipelines versionBuilder;
1515

1616
private IEnvironment environment;

src/GitVersionCore.Tests/BuildServers/AzurePipelinesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace GitVersionCore.Tests.BuildServers
99
[TestFixture]
1010
public class AzurePipelinesTests : TestBase
1111
{
12-
private string key = "BUILD_BUILDNUMBER";
12+
private readonly string key = "BUILD_BUILDNUMBER";
1313

1414
private IEnvironment environment;
1515
private ILog log;

src/GitVersionCore.Tests/BuildServers/EnvironmentVariableJenkinsTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ namespace GitVersionCore.Tests.BuildServers
99
[TestFixture]
1010
public class EnvironmentVariableJenkinsTests : TestBase
1111
{
12-
private string key = "JENKINS_URL";
13-
private string branch = "GIT_BRANCH";
14-
private string localBranch = "GIT_LOCAL_BRANCH";
15-
private string pipelineBranch = "BRANCH_NAME";
12+
private readonly string key = "JENKINS_URL";
13+
private readonly string branch = "GIT_BRANCH";
14+
private readonly string localBranch = "GIT_LOCAL_BRANCH";
15+
private readonly string pipelineBranch = "BRANCH_NAME";
1616
private IEnvironment environment;
1717
private ILog log;
1818

src/GitVersionCore.Tests/Helpers/DirectoryHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace GitVersionCore.Tests.Helpers
77
{
88
public static class DirectoryHelper
99
{
10-
private static Dictionary<string, string> toRename = new Dictionary<string, string>
10+
private static readonly Dictionary<string, string> toRename = new Dictionary<string, string>
1111
{
1212
{"gitted", ".git"},
1313
{"gitmodules", ".gitmodules"},

src/GitVersionCore.Tests/Init/TestConsole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace GitVersionCore.Tests.Init
88
public class TestConsole : IConsole
99
{
1010
private readonly Queue<string> responses;
11-
private ILog log;
11+
private readonly ILog log;
1212

1313
public TestConsole(params string[] responses)
1414
{

src/GitVersionCore.Tests/IntegrationTests/MainlineDevelopmentMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace GitVersionCore.Tests.IntegrationTests
1414
{
1515
public class MainlineDevelopmentMode : TestBase
1616
{
17-
private Config config = new Config
17+
private readonly Config config = new Config
1818
{
1919
VersioningMode = VersioningMode.Mainline
2020
};

src/GitVersionCore.Tests/Mocks/MockBranch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public MockBranch()
2323

2424
}
2525

26-
private MockCommitLog commits = new MockCommitLog();
27-
private string friendlyName;
26+
private readonly MockCommitLog commits = new MockCommitLog();
27+
private readonly string friendlyName;
2828
public override string FriendlyName => friendlyName;
2929
public override ICommitLog Commits => commits;
3030
public override Commit Tip => commits.First();

src/GitVersionCore.Tests/Mocks/MockCommit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public MockCommit(ObjectId id = null)
2727
public Signature CommitterEx;
2828
public override Signature Committer => CommitterEx;
2929

30-
private ObjectId idEx;
30+
private readonly ObjectId idEx;
3131
public override ObjectId Id => idEx;
3232

3333
public override string Sha => idEx.Sha;

src/GitVersionCore.Tests/Mocks/MockThreadSleep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace GitVersionCore.Tests.Mocks
66
{
77
public class MockThreadSleep : IThreadSleep
88
{
9-
private Func<int, Task> Validator;
9+
private readonly Func<int, Task> Validator;
1010

1111
public MockThreadSleep(Func<int, Task> validator = null)
1212
{

src/GitVersionCore.Tests/TestEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace GitVersionCore.Tests
55
{
66
public class TestEnvironment : IEnvironment
77
{
8-
private IDictionary<string, string> map;
8+
private readonly IDictionary<string, string> map;
99

1010
public TestEnvironment()
1111
{

0 commit comments

Comments
 (0)