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
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public static AutoExpandReplicas Create(string value)
if (value.IsNullOrEmpty())
throw new ArgumentException("cannot be null or empty", nameof(value));

if (value.Equals("false", StringComparison.OrdinalIgnoreCase))
return Disabled;

var expandReplicaParts = value.Split('-');
if (expandReplicaParts.Length != 2)
throw new ArgumentException("must contain a 'from' and 'to' value", nameof(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ public void CreateWithMinAndAll()
autoExpandReplicas.ToString().Should().Be("0-all");
}

[U]
public void CreateWithFalse()
{
var autoExpandReplicas = Nest.AutoExpandReplicas.Create("false");
autoExpandReplicas.Should().NotBeNull();
autoExpandReplicas.Enabled.Should().BeFalse();
autoExpandReplicas.MinReplicas.Should().BeNull();
autoExpandReplicas.MaxReplicas.Should().BeNull();
autoExpandReplicas.ToString().Should().Be("false");
}

[U]
public void Disabled()
{
Expand Down