"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 EntityAttributePersistence_1 = require("../../../../Persistence/CdmFolder/EntityAttributePersistence");
describe('Persistence.CdmFolder.CdmEntityAttribute', () => {
    /**
     * Tests if calling from and to data maintain the properties description and displayName.
     */
    it('TestDescriptionAndDisplayName', () => {
        const corpus = new internal_1.CdmCorpusDefinition();
        const entityName = 'TheEntity';
        const description = 'entityAttributeDescription';
        const displayName = 'whatABeutifulDisplayName';
        const inputData = {
            'name': entityName,
            'displayName': displayName,
            'description': description,
            'entity': undefined
        };
        const instance = EntityAttributePersistence_1.EntityAttributePersistence.fromData(corpus.ctx, inputData);
        expect(instance.description)
            .toEqual(description);
        expect(instance.displayName)
            .toEqual(displayName);
        const data = EntityAttributePersistence_1.EntityAttributePersistence.toData(instance, undefined, undefined);
        expect(data.description)
            .toEqual(description);
        expect(data.displayName)
            .toEqual(displayName);
        // Checks if there is no residue of the transformation of the properties into traits.
        expect(data.appliedTraits)
            .toBeUndefined();
    });
});
//# sourceMappingURL=CdmEntityAttribute.test.js.map