public void NeedsRefreshReturnsTrueIfNoExpirationDate()
        {
            CloudStorageToken token = new CloudStorageToken {
                RefreshToken = "notempty"
            };

            Assert.IsTrue(token.NeedsRefresh());
        }
        public void NeedsRefreshReturnsFalseIfNotExpired()
        {
            CloudStorageToken token = new CloudStorageToken {
                RefreshToken = "notempty"
            };

            token.ExpiryDate = DateTime.Now.AddSeconds(8);
            Assert.IsFalse(token.NeedsRefresh());
        }
        public void NeedsRefreshReturnsFalseForTokenFlow()
        {
            // The token flow has no refresh token
            CloudStorageToken token = new CloudStorageToken {
                RefreshToken = null
            };

            token.ExpiryDate = DateTime.UtcNow.AddSeconds(-8); // Would have been expired
            Assert.IsFalse(token.NeedsRefresh());
        }