text: 'use strict';
  
  /* jshint ignore:start */
  /**
   * This code was generated by
   * \ / _    _  _|   _  _
   *  | (_)\/(_)(_|\/| |(/_  v1.0.0
   *       /       /
   */
  /* jshint ignore:end */
  
  var Holodeck = require('../../../../holodeck');  /* jshint ignore:line */
  var Request = require(
      '../../../../../../lib/http/request');  /* jshint ignore:line */
  var Response = require(
      '../../../../../../lib/http/response');  /* jshint ignore:line */
  var RestException = require(
      '../../../../../../lib/base/RestException');  /* jshint ignore:line */
  var Twilio = require('../../../../../../lib');  /* jshint ignore:line */
  
  
  var client;
  var holodeck;
  
  describe('Channel', function() {
    beforeEach(function() {
      holodeck = new Holodeck();
      client = new Twilio('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'AUTHTOKEN', {
        httpClient: holodeck
      });
    });
    it('should generate valid create request',
      function(done) {
        holodeck.mock(new Response(500, {}));
  
        var opts = {phoneNumberSid: 'PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'};
        var promise = client.preview.trusted_comms.brandedChannels('BWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                                  .channels.create(opts);
        promise.then(function() {
          throw new Error('failed');
        }, function(error) {
          expect(error.constructor).toBe(RestException.prototype.constructor);
          done();
        }).done();
  
        var brandedChannelSid = 'BWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
        var url = `https://preview.twilio.com/TrustedComms/BrandedChannels/${brandedChannelSid}/Channels`;
  
        var values = {PhoneNumberSid: 'PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', };
        holodeck.assertHasRequest(new Request({
            method: 'POST',
            url: url,
            data: values
        }));
      }
    );
    it('should generate valid create response',
      function(done) {
        var body = {
            'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'business_sid': 'BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'brand_sid': 'BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'branded_channel_sid': 'BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'phone_number_sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
            'phone_number': '+15000000000',
            'url': 'https://preview.twilio.com/TrustedComms/BrandedChannels/BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels'
        };
  
        holodeck.mock(new Response(201, body));
  
        var opts = {phoneNumberSid: 'PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'};
        var promise = client.preview.trusted_comms.brandedChannels('BWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                                                  .channels.create(opts);
        promise.then(function(response) {
          expect(response).toBeDefined();
          done();
        }, function() {
          throw new Error('failed');
        }).done();
      }
    );
  });
  