Check for invalid tokens:
Current:
checks:
Are_Invalid() {
token.length == 2 &&
token[0].IsNullOrWhiteSpace &&
token[1].IsNullOrWhiteSpace
}
so all three conditions must be true => token is invalid.
Expected:
But token length == 2 is valid
and a only one token[] being null or emptyshould result in invalid
Approach:
renamed all three checks to "Invalid_..."
checking for being invalid (i.e. token.length != 2)
and check all three conditionns with OR, ONE condition NOT met => invalid token.
Check for invalid tokens: Current: checks: Are_Invalid() { token.length == 2 && token[0].IsNullOrWhiteSpace && token[1].IsNullOrWhiteSpace } so all three conditions must be true => token is invalid. Expected: But token length == 2 is valid and a only one token[] being null or emptyshould result in invalid
Approach: renamed all three checks to "Invalid_..." checking for being invalid (i.e. token.length != 2)
and check all three conditionns with OR, ONE condition NOT met => invalid token.