2017-02-09 00:00:35 +00:00
|
|
|
module TS.SpaceTac {
|
2017-02-07 19:15:21 +00:00
|
|
|
describe("ValueEffect", function () {
|
|
|
|
it("adds an amount to a ship value", function () {
|
|
|
|
let effect = new ValueEffect("shield", 20);
|
|
|
|
|
|
|
|
let ship = new Ship();
|
|
|
|
ship.values.shield.setMaximal(80);
|
|
|
|
ship.setValue("shield", 55);
|
|
|
|
expect(ship.values.shield.get()).toEqual(55);
|
|
|
|
|
2017-05-28 22:16:50 +00:00
|
|
|
effect.applyOnShip(ship, ship);
|
2017-02-07 19:15:21 +00:00
|
|
|
expect(ship.values.shield.get()).toEqual(75);
|
|
|
|
|
2017-05-28 22:16:50 +00:00
|
|
|
effect.applyOnShip(ship, ship);
|
2017-02-07 19:15:21 +00:00
|
|
|
expect(ship.values.shield.get()).toEqual(80);
|
|
|
|
});
|
2017-02-08 00:18:54 +00:00
|
|
|
|
|
|
|
it("has a description", function () {
|
|
|
|
let effect = new ValueEffect("power", 12);
|
|
|
|
expect(effect.getDescription()).toEqual("power +12");
|
|
|
|
|
|
|
|
effect = new ValueEffect("power", -4);
|
|
|
|
expect(effect.getDescription()).toEqual("power -4");
|
|
|
|
});
|
2017-02-07 19:15:21 +00:00
|
|
|
});
|
|
|
|
}
|