-
Notifications
You must be signed in to change notification settings - Fork 15
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
Create Mock Http tests for Slack Tokens #524
Conversation
new | ||
{ | ||
Title = "Testing Unknown Slack Error", | ||
HttpStatusCode = HttpStatusCode.OK, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Slack almost always returns a 200 to any request, even if malformed. This catches if the response is not that.
{ | ||
case "token_revoked": | ||
case "account_inactive": { return ValidationState.Expired; } | ||
case "invalid_auth": { return ReturnUnauthorizedAccess(ref message, fingerprint.Secret); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SlackTokenValidator
from usingWebClient
toHttpClient
SlackTokenValidatorTests
to properly test all code paths.