1
0
Fork 0
spacetac/src/core/StarLocation.spec.ts

32 lines
1.1 KiB
TypeScript
Raw Normal View History

2017-02-09 00:00:35 +00:00
module TS.SpaceTac.Specs {
describe("StarLocation", () => {
it("removes generated encounters that lose", function () {
2017-03-09 17:11:00 +00:00
var location = new StarLocation(undefined, StarLocationType.PLANET, 0, 0);
var fleet = new Fleet();
2017-03-14 22:28:07 +00:00
location.encounter_random = new SkewedRandomGenerator([0]);
var battle = location.enterLocation(fleet);
expect(location.encounter).not.toBeNull();
expect(battle).not.toBeNull();
2017-03-09 17:11:00 +00:00
nn(battle).endBattle(fleet);
expect(location.encounter).toBeNull();
});
it("leaves generated encounters that win", function () {
2017-03-09 17:11:00 +00:00
var location = new StarLocation(undefined, StarLocationType.PLANET, 0, 0);
var fleet = new Fleet();
2017-03-14 22:28:07 +00:00
location.encounter_random = new SkewedRandomGenerator([0]);
var battle = location.enterLocation(fleet);
expect(location.encounter).not.toBeNull();
expect(battle).not.toBeNull();
2017-03-09 17:11:00 +00:00
nn(battle).endBattle(location.encounter);
expect(location.encounter).not.toBeNull();
});
});
}