From fa8de1e4999a35f0c2cb54ef69f48e861e6f7a1f Mon Sep 17 00:00:00 2001 From: Renato Fernandes Soares Date: Thu, 26 Aug 2021 15:38:18 -0300 Subject: [PATCH] feat: added tests to validations --- .../Cabother.Validations.Helpers.csproj | 2 +- .../Validation.cs | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Cabother.Validations.Helpers/Cabother.Validations.Helpers.csproj b/src/Cabother.Validations.Helpers/Cabother.Validations.Helpers.csproj index 897dca7..4188b58 100644 --- a/src/Cabother.Validations.Helpers/Cabother.Validations.Helpers.csproj +++ b/src/Cabother.Validations.Helpers/Cabother.Validations.Helpers.csproj @@ -3,7 +3,7 @@ net5.0 8.0 - 1.0.1 + 1.0.2 diff --git a/src/Cabother.Validations.Samples/Validation.cs b/src/Cabother.Validations.Samples/Validation.cs index faf8e85..ab6e83d 100644 --- a/src/Cabother.Validations.Samples/Validation.cs +++ b/src/Cabother.Validations.Samples/Validation.cs @@ -31,6 +31,14 @@ public bool ValidateStringParamNull(string param) return true; } + public bool ValidateStringParamNullAndNotAllowWhiteSpace(string param) + { + param.ThrowIfNull(false); + //... other method information + + return true; + } + public bool ValidateObjectParamNull(object param) { param.ThrowIfNull(nameof(param)); @@ -46,6 +54,30 @@ public bool ValidateIntegerParamOutOfRange(int param) return true; } + + public bool ValidateDecimalParamOutOfRange(decimal param) + { + param.ThrowIfOutOfRange(1, nameof(param)); + //... other method information + + return true; + } + + public bool ValidateLongParamOutOfRange(long param) + { + param.ThrowIfOutOfRange(1, nameof(param)); + //... other method information + + return true; + } + + public bool ValidateLongParamOutOfRange(Guid param) + { + param.ThrowIfInvalid(nameof(param)); + //... other method information + + return true; + } /// public void Dispose()