all files / dist/ TestFunctionGenerator.js

100% Statements 13/13
100% Branches 2/2
100% Functions 5/5
100% Lines 13/13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35      10×                           10× 10×            
"use strict";
var TestFunctionGenerator = (function () {
    /* istanbul ignore next */ function TestFunctionGenerator() {
    }
    TestFunctionGenerator.prototype.fillTestFile = function (testFile, structures) {
        var _loop_1 = function (structure) {
            // todo: support structures with type parameters
            if (structure.getTypeParameters().length > 0)
                return "continue";
            testFile.addFunction({
                name: "run" + structure.getName() + "Tests",
                isExported: true,
                parameters: [{
                        name: "actual",
                        type: structure.getNameWithTypeParameters()
                    }, {
                        name: "expected",
                        type: structure.getTestStructureNameWithTypeParameters()
                    }],
                onWriteFunctionBody: function (writer) {
                    writer.writeLine("new TestRunnerFactory().get" + structure.getName() + "TestRunner().runTest(actual, expected);");
                }
            });
        };
        for (var _i = 0, structures_1 = structures; _i < structures_1.length; _i++) {
            var structure = structures_1[_i];
            _loop_1(structure);
        }
    };
    return TestFunctionGenerator;
}());
exports.TestFunctionGenerator = TestFunctionGenerator;
 
//# sourceMappingURL=TestFunctionGenerator.js.map