diff --git a/src/Testcontainers/Configurations/CustomConfiguration.cs b/src/Testcontainers/Configurations/CustomConfiguration.cs index d497d7230..fe61e96b3 100644 --- a/src/Testcontainers/Configurations/CustomConfiguration.cs +++ b/src/Testcontainers/Configurations/CustomConfiguration.cs @@ -110,13 +110,15 @@ private T GetPropertyValue(string propertyName) { return (T)(object)(this.properties.TryGetValue(propertyName, out var propertyValue) && ("1".Equals(propertyValue, StringComparison.Ordinal) || (bool.TryParse(propertyValue, out var result) && result))); } + case TypeCode.String: { _ = this.properties.TryGetValue(propertyName, out var propertyValue); return (T)(object)propertyValue; } + default: - throw new InvalidOperationException(); + throw new ArgumentOutOfRangeException(typeof(T).Name); } } }