"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const testHelper_1 = require("../../testHelper");
const projectionTestUtils_1 = require("../../Utilities/projectionTestUtils");
describe('Cdm/Projection/ProjectionFKTest', () => {
    const resOptsCombinations = [
        [],
        ['referenceOnly'],
        ['normalized'],
        ['structured'],
        ['referenceOnly', 'normalized'],
        ['referenceOnly', 'structured'],
        ['normalized', 'structured'],
        ['referenceOnly', 'normalized', 'structured']
    ];
    /**
     * The path between TestDataPath and TestName.
     */
    const testsSubpath = 'Cdm/Projection/ProjectionFKTest';
    it('TestEntityAttribute', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestEntityAttribute';
        const entityName = 'SalesEntityAttribute';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestEntityAttributeProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestEntityAttributeProj';
        const entityName = 'SalesEntityAttribute';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestSourceWithEA', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestSourceWithEA';
        const entityName = 'SalesSourceWithEA';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestSourceWithEAProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestSourceWithEAProj';
        const entityName = 'SalesSourceWithEA';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestGroupFK', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestGroupFK';
        const entityName = 'SalesGroupFK';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestGroupFKProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestGroupFKProj';
        const entityName = 'SalesGroupFK';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestNestedFKProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestNestedFKProj';
        const entityName = 'SalesNestedFK';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestPolymorphic', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestPolymorphic';
        const entityName = 'PersonPolymorphicSource';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestPolymorphicProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestPolymorphicProj';
        const entityName = 'PersonPolymorphicSource';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestPolymorphicFKProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestPolymorphicFKProj';
        const entityName = 'PersonPolymorphicSourceFK';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestArraySource', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestArraySource';
        const entityName = 'SalesArraySource';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestArraySourceProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestArraySourceProj';
        const entityName = 'SalesArraySource';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestForeignKey', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestForeignKey';
        const entityName = 'SalesForeignKey';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestForeignKeyProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestForeignKeyProj';
        const entityName = 'SalesForeignKey';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestForeignKeyAlways', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestForeignKeyAlways';
        const entityName = 'SalesForeignKeyAlways';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
    it('TestCompositeKeyProj', () => __awaiter(void 0, void 0, void 0, function* () {
        const testName = 'TestCompositeKeyProj';
        const entityName = 'SalesCompositeKey';
        const corpus = testHelper_1.testHelper.getLocalCorpus(testsSubpath, testName);
        for (const resOpt of resOptsCombinations) {
            yield projectionTestUtils_1.projectionTestUtils.loadEntityForResolutionOptionAndSave(corpus, testName, testsSubpath, entityName, resOpt);
        }
    }));
});
//# sourceMappingURL=ProjectionFK.test.js.map