diff --git a/src/DiffEngine/Guard.cs b/src/DiffEngine/Guard.cs index 8ce175ef..b6360b70 100644 --- a/src/DiffEngine/Guard.cs +++ b/src/DiffEngine/Guard.cs @@ -1,8 +1,8 @@ static class Guard { - public static void AgainstNegativeAndZero(int value, string argumentName) + public static void AgainstNegative(int value, string argumentName) { - if (value <= 0) + if (value < 0) { throw new ArgumentOutOfRangeException(argumentName); } diff --git a/src/DiffEngine/MaxInstance.cs b/src/DiffEngine/MaxInstance.cs index 57edb7a0..3a14d6cb 100644 --- a/src/DiffEngine/MaxInstance.cs +++ b/src/DiffEngine/MaxInstance.cs @@ -33,14 +33,14 @@ static int GetMaxInstances() => public static void SetForAppDomain(int value) { - Guard.AgainstNegativeAndZero(value, nameof(value)); + Guard.AgainstNegative(value, nameof(value)); appDomainMaxInstancesToLaunch = value; ResetCapturedValue(); } public static void SetForUser(int value) { - Guard.AgainstNegativeAndZero(value, nameof(value)); + Guard.AgainstNegative(value, nameof(value)); EnvironmentHelper.Set("DiffEngine_MaxInstances", value.ToString()); ResetCapturedValue(); } diff --git a/src/DiffEngineTray/Settings/OptionsForm.Designer.cs b/src/DiffEngineTray/Settings/OptionsForm.Designer.cs index 0da00b15..8343bd6d 100644 --- a/src/DiffEngineTray/Settings/OptionsForm.Designer.cs +++ b/src/DiffEngineTray/Settings/OptionsForm.Designer.cs @@ -244,7 +244,7 @@ void InitializeComponent() this.maxInstancesNumericUpDown.Margin = new System.Windows.Forms.Padding(5); this.maxInstancesNumericUpDown.Minimum = new decimal(new int[] { - 1, + 0, 0, 0, 0 @@ -254,7 +254,7 @@ void InitializeComponent() this.maxInstancesNumericUpDown.TabIndex = 0; this.maxInstancesNumericUpDown.Value = new decimal(new int[] { - 1, + 0, 0, 0, 0 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 6051fa93..8ce705d1 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591;CS0649;NU1608;NU1109 - 16.7.1 + 16.7.2 1.0.0 Testing, Snapshot, Diff, Compare Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.