public void TestBotTokenInvalidThrowsArgumentException(string token) { Assert.Throws <ArgumentException>(() => TokenUtils.ValidateToken(TokenType.Bot, token)); }
public void TestBearerTokenDoesNotThrowExceptions(string token) { TokenUtils.ValidateToken(TokenType.Bearer, token); }
public void TestWebhookTokenDoesNotThrowExceptions(string token) { TokenUtils.ValidateToken(TokenType.Webhook, token); }
public void TestUnrecognizedTokenType(int type) { Assert.Throws <ArgumentException>(() => TokenUtils.ValidateToken((TokenType)type, "MTk4NjIyNDgzNDcxOTI1MjQ4.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs")); }
public void TestPadBase64String(string input, string expected) { Assert.Equal(expected, TokenUtils.PadBase64String(input)); }
public void TestCheckBotTokenValidity(string token, bool expected) { Assert.Equal(expected, TokenUtils.CheckBotTokenValidity(token)); }