2017-09-24 22:23:22 +00:00
|
|
|
module TK.SpaceTac.Specs {
|
2017-10-26 21:47:13 +00:00
|
|
|
testing("ShipGenerator", test => {
|
|
|
|
test.case("can use ship model", check => {
|
2015-05-05 19:49:33 +00:00
|
|
|
var gen = new ShipGenerator();
|
2017-05-23 16:43:05 +00:00
|
|
|
var model = new ShipModel("test", "Test", 1, 2, true, 3);
|
2017-12-12 22:17:25 +00:00
|
|
|
var ship = gen.generate(1, model, false);
|
2017-10-26 21:47:13 +00:00
|
|
|
check.same(ship.model, model);
|
|
|
|
check.equals(ship.cargo_space, 2);
|
|
|
|
check.equals(ship.slots.length, 7);
|
|
|
|
check.same(ship.slots[0].type, SlotType.Hull);
|
|
|
|
check.same(ship.slots[1].type, SlotType.Shield);
|
|
|
|
check.same(ship.slots[2].type, SlotType.Power);
|
|
|
|
check.same(ship.slots[3].type, SlotType.Engine);
|
|
|
|
check.same(ship.slots[4].type, SlotType.Weapon);
|
|
|
|
check.same(ship.slots[5].type, SlotType.Weapon);
|
|
|
|
check.same(ship.slots[6].type, SlotType.Weapon);
|
|
|
|
check.equals(ship.getAttribute("skill_materials"), 1);
|
2015-05-05 19:49:33 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|