Skip to content

Commit bf182b2

Browse files
committed
fix: Remove Sonar code smells
1 parent 8e0f6d5 commit bf182b2

File tree

5 files changed

+3
-13
lines changed

5 files changed

+3
-13
lines changed

src/Testcontainers.WebDriver/WebDriverContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task ExportVideoAsync(string target, CancellationToken ct = default
5757
var bytes = await _ffmpegContainer.ReadFileAsync(WebDriverBuilder.VideoFilePath, ct)
5858
.ConfigureAwait(false);
5959

60-
#if NET6_0_OR_GREATER
60+
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
6161
await File.WriteAllBytesAsync(target, bytes, ct)
6262
.ConfigureAwait(false);
6363
#else

src/Testcontainers/Configurations/WaitStrategies/RetryLimitExceededException.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,9 @@ namespace DotNet.Testcontainers.Configurations
44

55
public sealed class RetryLimitExceededException : Exception
66
{
7-
public RetryLimitExceededException()
8-
{
9-
}
10-
117
public RetryLimitExceededException(string message)
128
: base(message)
139
{
1410
}
15-
16-
public RetryLimitExceededException(string message, Exception inner)
17-
: base(message, inner)
18-
{
19-
}
2011
}
2112
}

src/Testcontainers/Containers/DockerContainer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ public WaitUntilPortBindingsMapped(DockerContainer parent)
575575
_ = WithTimeout(TimeSpan.FromSeconds(15));
576576
}
577577

578-
public override Task<bool> UntilAsync(IContainer _, CancellationToken ct = default)
578+
public override Task<bool> UntilAsync(IContainer container, CancellationToken ct = default)
579579
{
580580
var boundPorts = _parent._container.NetworkSettings.Ports.Values.Where(portBindings => portBindings != null).SelectMany(portBinding => portBinding).Count(portBinding => !string.IsNullOrEmpty(portBinding.HostPort));
581581
return Task.FromResult(_parent._configuration.PortBindings == null || /* IPv4 or IPv6 */ _parent._configuration.PortBindings.Count == boundPorts || /* IPv4 and IPv6 */ 2 * _parent._configuration.PortBindings.Count == boundPorts);

src/Testcontainers/Containers/ResourceReaper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public async ValueTask DisposeAsync()
156156

157157
try
158158
{
159-
#if NET8_0_OR_GREATER
159+
#if NET6_0_OR_GREATER
160160
await _maintainConnectionCts.CancelAsync()
161161
.ConfigureAwait(false);
162162
#else

src/Testcontainers/Containers/ResourceReaperException.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ namespace DotNet.Testcontainers.Containers
22
{
33
using System;
44

5-
[Serializable]
65
public sealed class ResourceReaperException : Exception
76
{
87
public ResourceReaperException(string message)

0 commit comments

Comments
 (0)