Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 6cbfecb

Browse files
committed
Fix more warnings
Suppress "CA1034:Nested types should not be visible" for unit tests. Use the expectSha variable.
1 parent 17e0ce8 commit 6cbfecb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

test/GitHub.Exports.UnitTests/GitServiceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public async Task EmptyRepository_ReturnsNull()
7171

7272
var sha = await target.GetLatestPushedSha(dir).ConfigureAwait(false);
7373

74-
Assert.That(sha, Is.Null);
74+
Assert.That(sha, Is.EqualTo(expectSha));
7575
}
7676
}
7777

@@ -255,11 +255,11 @@ static void AddTrackedBranch(Repository repo, Branch branch, Commit commit,
255255
repo.Branches.Update(branch, b => b.TrackedBranch = canonicalName);
256256
}
257257

258-
public async Task IntergrationTest()
258+
public static async Task IntergrationTest()
259259
{
260260
var path = @"C:\Source\github.com\dotnet\roslyn";
261261
var gitService = new GitService(new RepositoryFacade());
262-
var sha = await gitService.GetLatestPushedSha(path);
262+
var sha = await gitService.GetLatestPushedSha(path).ConfigureAwait(false);
263263
Console.WriteLine(sha);
264264
}
265265
}

test/GitHub.Exports.UnitTests/GlobalSuppressions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Project-level suppressions either have no target or are given
55
// a specific target and scoped to a namespace, type, member, etc.
66

7-
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Unit test names can contain a _")]
8-
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "Nested unit test classes should be visible", Scope = "type")]
7+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
8+
"Naming", "CA1707:Identifiers should not contain underscores",
9+
Justification = "Unit test names can contain a _")]
910

11+
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
12+
"Design", "CA1034:Nested types should not be visible",
13+
Justification = "Nested unit test classes should be visible")]

0 commit comments

Comments
 (0)