"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 Storage_1 = require("../../Storage");
/**
 * Tests if the CdmStandardsAdapter functions correctly.
 */
describe('Storage.CdmStandardsAdapter', () => {
    const ENDPOINT = "https://cdm-schema.microsoft.com/logical";
    const TEST_FILE_PATH = "/foundations.cdm.json";
    /**
     * Tests if the adapter path is created correctly.
     */
    it('CreateAdapterPath', () => {
        const adapter = new Storage_1.CdmStandardsAdapter();
        const corpusPath = TEST_FILE_PATH;
        const adapterPath = adapter.createAdapterPath(corpusPath);
        expect(adapterPath).toEqual(`${ENDPOINT}${corpusPath}`);
    });
    /**
     * Tests if the corpus path is created correctly.
     */
    it('CreateCorpusPath', () => {
        const adapter = new Storage_1.CdmStandardsAdapter();
        const adapterPath = `${ENDPOINT}${TEST_FILE_PATH}`;
        const corpusPath = adapter.createCorpusPath(adapterPath);
        expect(corpusPath).toEqual(TEST_FILE_PATH);
    });
    /**
     * Tests if the adapter is able to read correctly.
     */
    it('ReadAsync', (done) => __awaiter(void 0, void 0, void 0, function* () {
        const adapter = new Storage_1.CdmStandardsAdapter();
        const foundations = yield adapter.readAsync(TEST_FILE_PATH);
        expect(foundations).not.toBeNull();
        done();
    }));
});
//# sourceMappingURL=cdmStandardsAdapter.test.js.map