{"size": 1240, "ext": "js", "max_stars_repo_path": "src/lib/unit/auxdata.test.js", "max_stars_repo_name": "11qats/TI4-TTPG", "max_stars_repo_stars_event_min_datetime": "2022-01-18T17:40:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-17T22:32:43.000Z", "max_issues_repo_path": "src/lib/unit/auxdata.test.js", "max_issues_repo_name": "11qats/TI4-TTPG", "max_issues_repo_issues_event_min_datetime": "2022-01-19T06:09:47.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-26T17:13:14.000Z", "max_forks_repo_path": "src/lib/unit/auxdata.test.js", "max_forks_repo_name": "11qats/TI4-TTPG", "max_forks_repo_forks_event_min_datetime": "2022-01-18T18:11:32.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-14T04:03:52.000Z"}
{"max_stars_count": 6, "max_issues_count": 27, "max_forks_count": 12, "avg_line_length": 34.4444444444, "max_line_length": 69, "alphanum_fraction": 0.685483871}
require("../../global"); // create globalEvents.TI4
const assert = require("assert");
const { AuxDataBuilder, AuxData } = require("./auxdata");
const { world } = require("../../wrapper/api");

it("constructor", () => {
    const auxData = new AuxDataBuilder().build();
    assert(auxData instanceof AuxData);
});

it("rich constructor", () => {
    const playerSlot = 7;
    const faction = world.TI4.getFactionByNsidName("arborec");
    const hex = "<0,0,0>";
    const activatingPlayerSlot = 8;
    const activeSystem = world.TI4.getSystemByTileNumber(18);
    const activePlanet = activeSystem.planets[0];

    const auxData = new AuxDataBuilder()
        .setPlayerSlot(playerSlot)
        .setFaction(faction)
        .setHex(hex)
        .setActivatingPlayerSlot(activatingPlayerSlot)
        .setActiveSystem(activeSystem)
        .setActivePlanet(activePlanet)
        .build();
    assert(auxData instanceof AuxData);

    assert.equal(auxData.playerSlot, playerSlot);
    assert.equal(auxData.faction, faction);
    assert.equal(auxData.hex, hex);
    assert.equal(auxData.activatingPlayerSlot, activatingPlayerSlot);
    assert.equal(auxData.activeSystem, activeSystem);
    assert.equal(auxData.activePlanet, activePlanet);
});
