internal static bool IsAValidToken(HttpRequestMessage request, IAuthorizationBusinessLogic authorizationBusinessLogic) { bool isAValidToken = false; Guid token = GetToken(request); if (authorizationBusinessLogic.IsAValidToken(token)) { return(true); } else { throw new UnauthorizedAccessException("Token is not valid."); } }
public void TokenIsValid_validToken_True() { mockUserDataAccess.Setup(b1 => b1.Get(user.Token)).Returns(user); Assert.IsTrue(authorizationBusinessLogic.IsAValidToken(user.Token)); }