Skip to content

Commit b4a5ce0

Browse files
committed
Suppress warnings
1 parent a5328cf commit b4a5ce0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

BrowserGuard.Tests/NetLogger/NetLogSenderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,14 @@ public void KeepsWithoutRetryingWhenNoIntervalIsSet()
237237
"https://collector.example.com/log", null, collector, spool,
238238
retryInterval: TimeSpan.Zero);
239239
sender.Enqueue(Entry);
240-
Assert.Equal(1, Kept(PendingPath).Length);
240+
Assert.Single(Kept(PendingPath));
241241
var attempts = collector.Bodies.Count;
242242

243243
collector.Status = HttpStatusCode.OK;
244244
Thread.Sleep(500);
245245

246246
Assert.Equal(attempts, collector.Bodies.Count);
247-
Assert.Equal(1, Kept(PendingPath).Length);
247+
Assert.Single(Kept(PendingPath));
248248
}
249249

250250
// A collector that answers with an error must not stop the ones after it.

BrowserGuard.Tests/UploadFileBridge/FileBridgeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ string Source(string name = "report.xlsx", string content = "hello")
6565
}
6666

6767
string[] Copies => Directory.Exists(Destination)
68-
? Directory.GetFiles(Destination).Select(Path.GetFileName).OrderBy(name => name).ToArray()!
68+
? [.. Directory.GetFiles(Destination).Select(path => Path.GetFileName(path) ?? "").OrderBy(name => name)]
6969
: [];
7070

7171
[Fact]

BrowserGuard/Configuration/ConfigLoader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ internal static Config LoadConfig()
3333
}
3434
}
3535

36-
internal static string GetConfigPath()
36+
internal static string? GetConfigPath()
3737
{
3838
const string registryPath = @"SOFTWARE\BrowserGuard";
3939
const string valueName = "ConfigFile";
4040
try
4141
{
42-
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(registryPath))
42+
using (RegistryKey? key = Registry.LocalMachine.OpenSubKey(registryPath))
4343
{
4444
if (key == null)
4545
{
4646
Console.Error.WriteLine($"cannot read {registryPath}: key not found");
4747
return null;
4848
}
49-
object value = key.GetValue(valueName);
49+
object? value = key.GetValue(valueName);
5050
if (value is string configFile)
5151
{
5252
return configFile;

0 commit comments

Comments
 (0)