Browse Source

Fixed check for message in Guard.IsTrue and Guard.IsFalse

Former-commit-id: ab939ab1a09d5e7452fba067ad3247bb6c56c2d3
Former-commit-id: 2a1278a2f53cc94353fe7260f017a2d0ca4caace
Former-commit-id: e7a7466c02934551c49820fcb04b8b781af2c4fc
af/merge-core
dirk 10 years ago
parent
commit
28eb40145f
  1. 8
      src/ImageProcessorCore/Common/Helpers/Guard.cs

8
src/ImageProcessorCore/Common/Helpers/Guard.cs

@ -148,7 +148,7 @@ namespace ImageProcessorCore
/// <param name="max">The maximum value.</param>
/// <param name="parameterName">The name of the parameter that is to be checked.</param>
/// <typeparam name="TValue">The type of the value.</typeparam>
/// <exception cref="System.ArgumentException">
/// <exception cref="ArgumentException">
/// <paramref name="value"/> is less than the minimum value of greater than the maximum value.
/// </exception>
public static void MustBeBetweenOrEqualTo<TValue>(TValue value, TValue min, TValue max, string parameterName)
@ -173,14 +173,14 @@ namespace ImageProcessorCore
/// <param name="message">
/// The error message, if any to add to the exception.
/// </param>
/// <exception cref="System.ArgumentException">
/// <exception cref="ArgumentException">
/// <paramref name="target"/> is null
/// </exception>
public static void IsTrue(bool target, string parameterName, string message = "")
{
if (!target)
{
if (string.IsNullOrWhiteSpace(message))
if (!string.IsNullOrWhiteSpace(message))
{
throw new ArgumentException(parameterName, message);
}
@ -203,7 +203,7 @@ namespace ImageProcessorCore
{
if (target)
{
if (string.IsNullOrWhiteSpace(message))
if (!string.IsNullOrWhiteSpace(message))
{
throw new ArgumentException(parameterName, message);
}

Loading…
Cancel
Save