Skip to content

Commit

Permalink
fix: Remove Sonar code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Dec 8, 2024
1 parent 8e0f6d5 commit bf182b2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Testcontainers.WebDriver/WebDriverContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task ExportVideoAsync(string target, CancellationToken ct = default
var bytes = await _ffmpegContainer.ReadFileAsync(WebDriverBuilder.VideoFilePath, ct)
.ConfigureAwait(false);

#if NET6_0_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
await File.WriteAllBytesAsync(target, bytes, ct)
.ConfigureAwait(false);
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@ namespace DotNet.Testcontainers.Configurations

public sealed class RetryLimitExceededException : Exception
{
public RetryLimitExceededException()
{
}

public RetryLimitExceededException(string message)
: base(message)
{
}

public RetryLimitExceededException(string message, Exception inner)
: base(message, inner)
{
}
}
}
2 changes: 1 addition & 1 deletion src/Testcontainers/Containers/DockerContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ public WaitUntilPortBindingsMapped(DockerContainer parent)
_ = WithTimeout(TimeSpan.FromSeconds(15));
}

public override Task<bool> UntilAsync(IContainer _, CancellationToken ct = default)
public override Task<bool> UntilAsync(IContainer container, CancellationToken ct = default)
{
var boundPorts = _parent._container.NetworkSettings.Ports.Values.Where(portBindings => portBindings != null).SelectMany(portBinding => portBinding).Count(portBinding => !string.IsNullOrEmpty(portBinding.HostPort));
return Task.FromResult(_parent._configuration.PortBindings == null || /* IPv4 or IPv6 */ _parent._configuration.PortBindings.Count == boundPorts || /* IPv4 and IPv6 */ 2 * _parent._configuration.PortBindings.Count == boundPorts);
Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers/Containers/ResourceReaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public async ValueTask DisposeAsync()

try
{
#if NET8_0_OR_GREATER
#if NET6_0_OR_GREATER
await _maintainConnectionCts.CancelAsync()
.ConfigureAwait(false);
#else
Expand Down
1 change: 0 additions & 1 deletion src/Testcontainers/Containers/ResourceReaperException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace DotNet.Testcontainers.Containers
{
using System;

[Serializable]
public sealed class ResourceReaperException : Exception
{
public ResourceReaperException(string message)
Expand Down

0 comments on commit bf182b2

Please sign in to comment.