public void AttemptValidateToken()
        {
            string accessToken = "";//invalid value;
            var action = new ValidateTokenAction(accessToken, this.providerMock.Object);
            action.Execute();

            this.WriteValidationContextRuleResults(action.ValidationContext);
            Assert.IsFalse(action.IsValid);
        }
        public void CanValidateToken()
        {
            string accessToken = this.RetrieveCurrentAccessToken();
            TokenInfo tokenInfo = this.membershipService.RetrieveTokenInfo(accessToken);
            this.providerMock.Setup(c => c.GoogleClientId).Returns(this.membershipService.GoogleClientId);
            this.providerMock.Setup(t => t.GetTokenInfo(accessToken)).Returns(tokenInfo);

            var action = new ValidateTokenAction(accessToken, this.providerMock.Object);
            action.Execute();

            this.WriteValidationContextRuleResults(action.ValidationContext);
            Assert.IsTrue(action.IsValid);
        }
 /// <summary>
 ///     Validates the token.
 /// </summary>
 /// <param name="accessToken">The access token.</param>
 /// <returns></returns>
 public override bool ValidateToken(string accessToken)
 {
     bool isValid = false;
     ValidateTokenAction action = new ValidateTokenAction(accessToken, this);
     action.Execute();
     if (action.Result == ActionResult.Success)
     {
         isValid = action.IsValid;
     }
     return isValid;
 }