Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Testcontainers/Builders/ContainerBuilder`3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public TBuilderEntity WithResourceMapping(Uri source, DirectoryPath target, uint
var fileName = Path.GetFileName(source.LocalPath);

_ = Guard.Argument(source, nameof(source))
.ThrowIf(_ => string.IsNullOrEmpty(fileName), _ => new ArgumentException(string.Format(message, source), nameof(source)));
.ThrowIf(_ => string.IsNullOrEmpty(fileName), argument => new ArgumentException(string.Format(message, argument.Value), argument.Name));

var filePath = FilePath.Of(Path.Combine(target.Value, fileName));
return WithResourceMapping(source, filePath, uid, gid, fileMode);
Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers/Builders/DirectoryPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ public override string ToString()
return Value;
}
}
}
}
9 changes: 8 additions & 1 deletion src/Testcontainers/Builders/DockerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ public Uri GetCurrentEndpoint()

using (var sha256 = SHA256.Create())
{
var dockerContextHash = BitConverter.ToString(sha256.ComputeHash(Encoding.Default.GetBytes(dockerContext))).Replace("-", string.Empty).ToLowerInvariant();
var hashBytes = sha256.ComputeHash(Encoding.Default.GetBytes(dockerContext));

#if NET10_0_OR_GREATER
var dockerContextHash = Convert.ToHexStringLower(hashBytes);
#else
var dockerContextHash = BitConverter.ToString(hashBytes).Replace("-", string.Empty).ToLowerInvariant();
#endif

var metaFilePath = Path.Combine(_dockerConfigDirectoryPath, "contexts", "meta", dockerContextHash, "meta.json");

try
Expand Down
2 changes: 1 addition & 1 deletion src/Testcontainers/Builders/FilePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ public override string ToString()
return Value;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace DotNet.Testcontainers.Configurations
using System.Threading.Tasks;
using DotNet.Testcontainers.Containers;

internal class UntilDatabaseIsAvailable : IWaitUntil
internal sealed class UntilDatabaseIsAvailable : IWaitUntil
{
private readonly DbProviderFactory _dbProviderFactory;

Expand Down Expand Up @@ -45,7 +45,12 @@ await connection.OpenAsync()
}
finally
{
#if NETSTANDARD2_0
connection.Dispose();
#else
await connection.DisposeAsync()
.ConfigureAwait(false);
#endif
}
}
}
Expand Down
Loading