2017-11-14 00:07:06 +00:00
|
|
|
module TK.SpaceTac.Specs {
|
|
|
|
testing("DroneDeployedDiff", test => {
|
|
|
|
test.case("applies and reverts", check => {
|
|
|
|
let battle = TestTools.createBattle();
|
2019-05-19 22:32:15 +00:00
|
|
|
let ship = battle.fleets[0].ships[0];
|
|
|
|
let drone1 = new Drone(ship);
|
|
|
|
let drone2 = new Drone(ship, "test");
|
2017-11-14 00:07:06 +00:00
|
|
|
|
|
|
|
TestTools.diffChain(check, battle, [
|
2017-11-29 22:03:58 +00:00
|
|
|
new DroneDeployedDiff(drone1),
|
2017-11-14 00:07:06 +00:00
|
|
|
new DroneDeployedDiff(drone2),
|
2017-11-29 22:03:58 +00:00
|
|
|
new DroneRecalledDiff(drone1),
|
|
|
|
new DroneRecalledDiff(drone2),
|
2017-11-14 00:07:06 +00:00
|
|
|
], [
|
|
|
|
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");
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|