2017-02-09 00:00:35 +00:00
|
|
|
module TS.SpaceTac.Specs {
|
2015-05-05 19:49:33 +00:00
|
|
|
describe("ShipGenerator", function () {
|
|
|
|
it("can use ship model", function () {
|
|
|
|
var gen = new ShipGenerator();
|
2017-05-23 16:43:05 +00:00
|
|
|
var model = new ShipModel("test", "Test", 1, 2, true, 3);
|
2015-05-05 19:49:33 +00:00
|
|
|
var ship = gen.generate(1, model);
|
2017-04-25 23:27:42 +00:00
|
|
|
expect(ship.model).toBe(model);
|
2017-03-05 17:48:13 +00:00
|
|
|
expect(ship.cargo_space).toBe(2);
|
2017-05-23 16:43:05 +00:00
|
|
|
expect(ship.slots.length).toBe(7);
|
|
|
|
expect(ship.slots[0].type).toBe(SlotType.Hull);
|
|
|
|
expect(ship.slots[1].type).toBe(SlotType.Shield);
|
|
|
|
expect(ship.slots[2].type).toBe(SlotType.Power);
|
|
|
|
expect(ship.slots[3].type).toBe(SlotType.Engine);
|
|
|
|
expect(ship.slots[4].type).toBe(SlotType.Weapon);
|
|
|
|
expect(ship.slots[5].type).toBe(SlotType.Weapon);
|
|
|
|
expect(ship.slots[6].type).toBe(SlotType.Weapon);
|
2017-06-11 20:44:12 +00:00
|
|
|
expect(ship.getAttribute("skill_materials")).toBe(1);
|
2015-05-05 19:49:33 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|