static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/user/account
        string AccountSid   = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string AuthToken    = "your_auth_token";
        string WorkspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        string TaskQueueSid = "WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

        TaskRouterTaskQueueCapability capability = new TaskRouterTaskQueueCapability(AccountSid, AuthToken, WorkspaceSid, TaskQueueSid);

        capability.AllowFetchSubresources();
        capability.AllowUpdates();
        var token = capability.GenerateToken();

        // By default, tokens are good for one hour.
        // Override this default timeout by specifiying a new value (in seconds).
        // For example, to generate a token good for 8 hours:

        token = capability.GenerateToken(28800); // 60 * 60 * 8
    }
        public void ShouldGenerateToken()
        {
            var token = cap.GenerateToken();

            Assert.IsNotNullOrEmpty(token);

            var payload = JsonWebToken.DecodeToObject(token, "foobar") as IDictionary <string, object>;

            Assert.AreEqual("AC123", payload["iss"]);
            Assert.AreEqual("AC123", payload["account_sid"]);
            Assert.AreEqual("WS456", payload["workspace_sid"]);
            Assert.AreEqual("WQ789", payload["taskqueue_sid"]);
            Assert.AreEqual("WQ789", payload["channel"]);
            Assert.AreEqual("v1", payload["version"]);
            Assert.AreEqual("WQ789", payload["friendly_name"]);
        }