"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 *  Tests for HTTP Client wrapper
 *
 *  Copyright (C) 2010-2020 R-T Specialty, LLC.
 *
 *  This file is part of the Liza Data Collection Framework.
 *
 *  liza is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
var chai = require("chai");
var HttpClient_1 = require("../../../src/system/network/HttpClient");
var chai_1 = require("chai");
chai.use(require('chai-as-promised'));
describe('HttpClient', function () {
    describe('isValidUrl', function () {
        it('detects a valid URL', function () {
            chai_1.expect(new HttpClient_1.HttpClient().isValidUrl('https://example.com')).to.be.true;
        });
        it('detects an invalid URL', function () {
            chai_1.expect(new HttpClient_1.HttpClient().isValidUrl('')).to.be.false;
        });
    });
    describe('validateUrl', function () {
        it('detects an invalid URL', function () {
            chai_1.expect(function () { return new HttpClient_1.HttpClient().validateUrl(''); }).to.throw(Error, 'The provided URL is invalid: ');
        });
    });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSHR0cENsaWVudFRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJIdHRwQ2xpZW50VGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsMkJBQThCO0FBQzlCLHFFQUF5RTtBQUN6RSw2QkFBNEI7QUFFNUIsSUFBSSxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxDQUFDO0FBRXRDLFF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