{"size": 2074, "ext": "js", "max_stars_repo_path": "test/services/cdnManagement/cdnOperation-tests.js", "max_stars_repo_name": "nmors/azure-sdk-for-node", "max_stars_repo_stars_event_min_datetime": "2016-12-19T22:19:53.000Z", "max_stars_repo_stars_event_max_datetime": "2016-12-19T22:19:53.000Z", "max_issues_repo_path": "test/services/cdnManagement/cdnOperation-tests.js", "max_issues_repo_name": "nmors/azure-sdk-for-node", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/services/cdnManagement/cdnOperation-tests.js", "max_forks_repo_name": "nmors/azure-sdk-for-node", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.0579710145, "max_line_length": 101, "alphanum_fraction": 0.6870781099}
﻿//
// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
var should = require('should');
var util = require('util');
var msRestAzure = require('ms-rest-azure');

var SuiteBase = require('../../framework/suite-base');
var FileTokenCache = require('../../../lib/util/fileTokenCache');
var StorageManagementClient = require('../../../lib/services/cdnManagement/lib/cdnManagementClient');
var testPrefix = 'cdnOperation-tests';

var requiredEnvironment = [{
  name: 'AZURE_TEST_LOCATION',
  defaultValue: 'West US'
}];

var suite;
var client;
var defaultLocation;

describe('Cdn Management Operation', function() {
  before(function(done) {
    suite = new SuiteBase(this, testPrefix, requiredEnvironment);
    suite.setupSuite(function() {
      client = new StorageManagementClient(suite.credentials, suite.subscriptionId);
      if (suite.isPlayback) {
        client.longRunningOperationRetryTimeout = 0;
      }
      done();
    });
  });

  after(function(done) {
    suite.teardownSuite(done);
  });

  beforeEach(function(done) {
    suite.setupTest(done);
  });

  afterEach(function(done) {
    suite.baseTeardownTest(done);
  });

  describe('cdn operations', function() {
    it('should list cdn management operations', function(done) {
      client.listOperations(function(err, result, request, response) {
        should.not.exist(err);
        should.exist(result);
        var operations = result;
        operations.length.should.not.equal(0);
        done();
      });
    });
  });
});