1
0
Fork 0
spacetac/src/core/diffs/DroneDeployedDiff.spec.ts

33 lines
1.2 KiB
TypeScript

module TK.SpaceTac.Specs {
testing("DroneDeployedDiff", test => {
test.case("applies and reverts", check => {
let battle = TestTools.createBattle();
let ship = battle.fleets[0].ships[0];
let drone1 = new Drone(ship);
let drone2 = new Drone(ship, "test");
TestTools.diffChain(check, battle, [
new DroneDeployedDiff(drone1),
new DroneDeployedDiff(drone2),
new DroneRecalledDiff(drone1),
new DroneRecalledDiff(drone2),
], [
check => {
check.equals(battle.drones.count(), 0, "drone count");
},
check => {
check.equals(battle.drones.count(), 1, "drone count");
},
check => {
check.equals(battle.drones.count(), 2, "drone count");
},
check => {
check.equals(battle.drones.count(), 1, "drone count");
},
check => {
check.equals(battle.drones.count(), 0, "drone count");
},
]);
});
});
}