2017-09-24 22:23:22 +00:00
|
|
|
module TK.SpaceTac.Specs {
|
2017-10-26 21:47:13 +00:00
|
|
|
testing("TestTools", test => {
|
|
|
|
test.case("set ship power", check => {
|
2017-04-18 19:51:23 +00:00
|
|
|
let ship = new Ship();
|
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
check.equals(ship.getAttribute("power_capacity"), 0);
|
|
|
|
check.equals(ship.getAttribute("power_generation"), 0);
|
|
|
|
check.equals(ship.getValue("power"), 0);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
|
|
|
TestTools.setShipAP(ship, 12, 4);
|
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
check.equals(ship.getAttribute("power_capacity"), 12);
|
|
|
|
check.equals(ship.getAttribute("power_generation"), 4);
|
|
|
|
check.equals(ship.getValue("power"), 12);
|
2017-04-18 19:51:23 +00:00
|
|
|
});
|
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
test.case("set ship health", check => {
|
2017-04-18 19:51:23 +00:00
|
|
|
let ship = new Ship();
|
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
check.equals(ship.getAttribute("hull_capacity"), 0);
|
|
|
|
check.equals(ship.getAttribute("shield_capacity"), 0);
|
|
|
|
check.equals(ship.getValue("hull"), 0);
|
|
|
|
check.equals(ship.getValue("shield"), 0);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
|
|
|
TestTools.setShipHP(ship, 100, 200);
|
|
|
|
|
2017-10-26 21:47:13 +00:00
|
|
|
check.equals(ship.getAttribute("hull_capacity"), 100);
|
|
|
|
check.equals(ship.getAttribute("shield_capacity"), 200);
|
|
|
|
check.equals(ship.getValue("hull"), 100);
|
|
|
|
check.equals(ship.getValue("shield"), 200);
|
2017-04-18 19:51:23 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|