{"size": 1182, "ext": "js", "max_stars_repo_path": "libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js", "max_stars_repo_name": "stefangomez/botbuilder-js", "max_stars_repo_stars_event_min_datetime": "2019-05-09T12:20:27.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T16:37:55.000Z", "max_issues_repo_path": "libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js", "max_issues_repo_name": "stefangomez/botbuilder-js", "max_issues_repo_issues_event_min_datetime": "2019-05-06T21:06:38.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T20:35:22.000Z", "max_forks_repo_path": "libraries/botbuilder-dialogs-adaptive/tests/languageGeneratorConverter.test.js", "max_forks_repo_name": "stefangomez/botbuilder-js", "max_forks_repo_forks_event_min_datetime": "2019-05-10T15:35:07.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-31T17:25:34.000Z"}
{"max_stars_count": 345, "max_issues_count": 2931, "max_forks_count": 168, "avg_line_length": 43.7777777778, "max_line_length": 141, "alphanum_fraction": 0.7081218274}
const { ResourceMultiLanguageGenerator } = require('../');
const { LanguageGeneratorConverter } = require('../lib/converters');
const { ok, strictEqual } = require('assert');

describe('LanguageGeneratorConverter', function () {
    it('convert() should return new ResourceMultiLanguageGenerator with string param', () => {
        const converter = new LanguageGeneratorConverter();
        const newGenerator = converter.convert('');
        ok(newGenerator instanceof ResourceMultiLanguageGenerator, 'expected newGenerator to be instance of ResourceMultiLanguageGenerator');
    });

    it('convert() should return param if param type is not string', () => {
        const firstGenerator = new ResourceMultiLanguageGenerator('resourceId');
        const converter = new LanguageGeneratorConverter();
        const newGenerator = converter.convert(firstGenerator);
        strictEqual(newGenerator, firstGenerator);

        // Bad generator scenarios:
        const undefinedGenerator = converter.convert(undefined);
        strictEqual(undefinedGenerator, undefined);

        const numberGenerator = converter.convert(2);
        strictEqual(numberGenerator, 2);

    });
});
