Skip to content

Commit

Permalink
feat: added tests to validations
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato Fernandes Soares authored and Renato Fernandes Soares committed Aug 26, 2021
1 parent 794dbee commit fa8de1e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>8.0</LangVersion>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
</PropertyGroup>

<PropertyGroup Label="Package">
Expand Down
32 changes: 32 additions & 0 deletions src/Cabother.Validations.Samples/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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;
}

/// <inheritdoc cref="IDisposable.Dispose"/>
public void Dispose()
Expand Down

0 comments on commit fa8de1e

Please sign in to comment.