1
0
Fork 0
spacetac/src/game/specs/StarLocation.spec.ts
2017-01-03 23:17:52 +01:00

34 lines
1.1 KiB
TypeScript

module SpaceTac.Game.Specs {
"use strict";
describe("StarLocation", () => {
it("removes generated encounters that lose", function () {
var location = new StarLocation(null, StarLocationType.PLANET, 0, 0);
var fleet = new Fleet();
var random = new RandomGenerator(0);
var battle = location.enterLocation(fleet, random);
expect(location.encounter).not.toBeNull();
expect(battle).not.toBeNull();
battle.endBattle(fleet);
expect(location.encounter).toBeNull();
});
it("leaves generated encounters that win", function () {
var location = new StarLocation(null, StarLocationType.PLANET, 0, 0);
var fleet = new Fleet();
var random = new RandomGenerator(0);
var battle = location.enterLocation(fleet, random);
expect(location.encounter).not.toBeNull();
expect(battle).not.toBeNull();
battle.endBattle(location.encounter);
expect(location.encounter).not.toBeNull();
});
});
}