"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
const internal_1 = require("../../internal");
const testHelper_1 = require("../testHelper");
describe('Cdm/LocalEntityDeclarationDefinitionTests', () => {
    /**
     * Tests if the copy function creates copies of the sub objects
     */
    it('testLocalEntityDeclarationDefinitionCopy', () => {
        const corpus = testHelper_1.testHelper.getLocalCorpus('', 'testLocalEntityDeclarationDefinitionCopy', undefined, undefined, undefined, true);
        const entity = new internal_1.CdmLocalEntityDeclarationDefinition(corpus.ctx, 'name');
        const dataPartitionName = 'dataPartitionName';
        const dataPartitionPatternName = 'dataPartitionPatternName';
        const incrementalPartitionName = 'incrementalPartitionName';
        const incrementalPartitionPatternName = "incrementalPartitionPatternName";
        const dataPartition = entity.dataPartitions.push(dataPartitionName);
        const dataPartitionPattern = entity.dataPartitionPatterns.push(dataPartitionPatternName);
        const incrementalPartition = entity.incrementalPartitions.push(incrementalPartitionName);
        const incrementalPartitionPattern = entity.incrementalPartitionPatterns.push(incrementalPartitionPatternName);
        const copy = entity.copy();
        copy.dataPartitions.allItems[0].name = 'newDataPartitionName';
        copy.dataPartitionPatterns.allItems[0].name = 'newDataPartitionPatternName';
        copy.incrementalPartitions.allItems[0].name = 'newIncrementalPartitionName';
        copy.incrementalPartitionPatterns.allItems[0].name = 'newIncrementalPartitionPatternName';
        expect(dataPartition.name)
            .toBe(dataPartitionName);
        expect(dataPartitionPattern.name)
            .toBe(dataPartitionPatternName);
        expect(incrementalPartition.name)
            .toBe(incrementalPartitionName);
        expect(incrementalPartitionPattern.name)
            .toBe(incrementalPartitionPatternName);
    });
});
//# sourceMappingURL=LocalEntityDeclarationDefinition.test.js.map