"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 *  Tests for Program Factory
 *
 *  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 ProgramFactory_1 = require("../../../src/dullahan/program/ProgramFactory");
var chai_1 = require("chai");
var data = null;
before(function () {
    data = null;
});
describe('ProgramFactory', function () {
    describe('createProgram', function () {
        it('returns a bucket and a program from a passed in bucket', function () {
            var sut = new ProgramFactory_1.ProgramFactory(createProgram, createBucket);
            var data = { foo: 'bar' };
            var bucket = sut.createProgram(data).bucket;
            chai_1.expect(bucket.getData()).to.deep.equal(data);
        });
        it('returns a bucket and a program with no bucket passed in', function () {
            var sut = new ProgramFactory_1.ProgramFactory(createProgram, createBucket);
            var data = {};
            var bucket = sut.createProgram(data).bucket;
            chai_1.expect(bucket.getData()).to.deep.equal(data);
        });
    });
});
var createProgram = function () {
    return {
        initQuote: function (_bucket, _store_only) { },
        meta: { groups: {} },
        groupExclusiveFields: {},
    };
};
var createBucket = function () {
    return {
        setValues: function (_data) {
            data = _data;
            return this;
        },
        getData: function () {
            return data;
        },
    };
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHJvZ3JhbUZhY3RvcnlUZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiUHJvZ3JhbUZhY3RvcnlUZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUE7Ozs7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