Skip to content

Obsolete properties with typo #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2020
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
4 changes: 4 additions & 0 deletions src/Radical.Tests/API/APIApprovals.Approve_API.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,12 @@ namespace Radical.Helpers
public bool AllowRepeatCharacters { get; set; }
public bool AllowSymbols { get; set; }
public System.Collections.Generic.List<char> Exclusions { get; }
[System.Obsolete("Use the MaxLength property, this will be removed in v3.0.0")]
public int MaxLenght { get; set; }
public int MaxLength { get; set; }
[System.Obsolete("Use the MinLength property, this will be removed in v3.0.0")]
public int MinLenght { get; set; }
public int MinLength { get; set; }
protected int GetCryptographicRandomNumber(int lBound, int uBound) { }
protected char GetRandomCharacter() { }
public string Next() { }
Expand Down
46 changes: 34 additions & 12 deletions src/Radical/Helpers/RandomStrings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,44 +144,66 @@ public List<char> Exclusions
get { return _exclusions; }
}

private int _minLenght = DEFAULT_MINIMUM;
private int _minLength = DEFAULT_MINIMUM;

/// <summary>
/// Minimum char number of the generated password
/// </summary>
/// <value>The min length.</value>
public int MinLenght
public int MinLength
{
get { return _minLenght; }
get { return _minLength; }
set
{
_minLenght = value;
if (DEFAULT_MINIMUM > _minLenght)
_minLength = value;
if (DEFAULT_MINIMUM > _minLength)
{
_minLenght = DEFAULT_MINIMUM;
_minLength = DEFAULT_MINIMUM;
}
}
}

private int _maxLenght = DEFAULT_MAXIMUM;
/// <summary>
/// Minimum char number of the generated password
/// </summary>
/// <value>The min length.</value>
[Obsolete("Use the MinLength property, this will be removed in v3.0.0")]
public int MinLenght
{
get { return MinLength; }
set { MinLength = value; }
}

private int _maxLength = DEFAULT_MAXIMUM;

/// <summary>
/// Maximum char number of the generated password
/// </summary>
/// <value>The max length.</value>
public int MaxLenght
public int MaxLength
{
get { return _maxLenght; }
get { return _maxLength; }
set
{
_maxLenght = value;
if (_minLenght >= _maxLenght)
_maxLength = value;
if (_minLength >= _maxLength)
{
_maxLenght = DEFAULT_MAXIMUM;
_maxLength = DEFAULT_MAXIMUM;
}
}
}

/// <summary>
/// Maximum char number of the generated password
/// </summary>
/// <value>The max length.</value>
[Obsolete("Use the MaxLength property, this will be removed in v3.0.0")]
public int MaxLenght
{
get { return MaxLength; }
set { MaxLength = value; }
}


/// <summary>
/// Gets or sets a value indicating whether symbols are allowed.
Expand Down