"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/**
 * Copyright 2017-2020 Plexus Interop Deutsche Bank AG
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
var setup_1 = require("./setup");
var path = require("path");
var GenCSharpCommand_1 = require("../../src/commands/GenCSharpCommand");
describe('C# Client generation CLI', function () {
    it('Generates C# client and messages definitions', function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
        var testName, genCommand, outDir, _a, _b, _c, _d;
        return tslib_1.__generator(this, function (_e) {
            switch (_e.label) {
                case 0:
                    testName = 'generated-cs-client';
                    genCommand = new GenCSharpCommand_1.GenCSharpCommand();
                    outDir = setup_1.prepareOutDir(testName);
                    return [4 /*yield*/, genCommand.action({
                            out: outDir,
                            baseDir: setup_1.getTestBaseDir(),
                            input: setup_1.getTestClientInput(),
                            namespace: 'plexus'
                        })];
                case 1:
                    _e.sent();
                    _a = expect;
                    return [4 /*yield*/, setup_1.filesEqual(path.join(outDir, 'interop/samples/GreetingClient.app.g.cs'), path.join(setup_1.getApprovalsBaseDir(), 'generated-cs-client.approved.txt'))];
                case 2:
                    _a.apply(void 0, [_e.sent()]).toBeTruthy();
                    _b = expect;
                    return [4 /*yield*/, setup_1.filesEqual(path.join(outDir, 'interop/samples/GreetingService.msg.g.cs'), path.join(setup_1.getApprovalsBaseDir(), 'generated-cs-messages.approved.txt'))];
                case 3:
                    _b.apply(void 0, [_e.sent()]).toBeTruthy();
                    _c = expect;
                    return [4 /*yield*/, setup_1.filesEqual(path.join(outDir, 'interop/samples/GreetingService.svc.g.cs'), path.join(setup_1.getApprovalsBaseDir(), 'generated-cs-service.approved.txt'))];
                case 4:
                    _c.apply(void 0, [_e.sent()]).toBeTruthy();
                    _d = expect;
                    return [4 /*yield*/, setup_1.filesEqual(path.join(outDir, 'interop/Options.msg.g.cs'), path.join(setup_1.getApprovalsBaseDir(), 'generated-cs-options.approved.txt'))];
                case 5:
                    _d.apply(void 0, [_e.sent()]).toBeTruthy();
                    return [2 /*return*/];
            }
        });
    }); }, 15000);
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiR2VuQ1NoYXJwQ29tbWFuZC5zcGVjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vdGVzdHMvY29tbWFuZHMvR2VuQ1NoYXJwQ29tbWFuZC5zcGVjLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7R0FlRztBQUNILGlDQUE2RztBQUM3RywyQkFBNkI7QUFDN0Isd0VBQXVFO0FBRXZFLFFBQVEsQ0FBQywwQkFBMEIsRUFBRTtJQUVqQyxFQUFFLENBQUMsOENBQThDLEVBQUU7Ozs7O29CQUV6QyxRQUFRLEdBQUcscUJBQXFCLENBQUM7b0JBQ2pDLFVBQVUsR0FBRyxJQUFJLG1DQUFnQixFQUFFLENBQUM7b0JBQ3BDLE1BQU0sR0FBRyxxQkFBYSxDQUFDLFFBQVEsQ0FBQyxDQUFDO29CQUV2QyxxQkFBTSxVQUFVLENBQUMsTUFBTSxDQUFDOzRCQUNwQixHQUFHLEVBQUUsTUFBTTs0QkFDWCxPQUFPLEVBQUUsc0JBQWMsRUFBRTs0QkFDekIsS0FBSyxFQUFFLDBCQUFrQixFQUFFOzRCQUMzQixTQUFTLEVBQUUsUUFBUTt5QkFDdEIsQ0FBQyxFQUFBOztvQkFMRixTQUtFLENBQUM7b0JBRUgsS0FBQSxNQUFNLENBQUE7b0JBQUMscUJBQU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