forked from github/server
bug 2197: add acceptance test for Wasser des Lebens
This commit is contained in:
parent
3911217fb5
commit
4397c67d1c
2 changed files with 32 additions and 0 deletions
|
@ -11,6 +11,22 @@ function setup()
|
||||||
eressea.settings.set("magic.regeneration.enable", "0")
|
eressea.settings.set("magic.regeneration.enable", "0")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_water_of_life()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
r.name = "Fountain of Life"
|
||||||
|
local f = faction.create("human")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
local trees = r:get_resource('sapling')
|
||||||
|
u:add_item('p2', 1)
|
||||||
|
u:add_item('log', 10)
|
||||||
|
u:add_order("BENUTZE 1 'Wasser des Lebens'")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(0, u:get_item('p2'))
|
||||||
|
assert_equal(0, u:get_item('log'))
|
||||||
|
process_orders()
|
||||||
|
assert_equal(trees+10, r:get_resource('sapling'))
|
||||||
|
end
|
||||||
|
|
||||||
function test_nestwarmth_insect()
|
function test_nestwarmth_insect()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
local f = faction.create("insect", "noreply@eressea.de", "de")
|
local f = faction.create("insect", "noreply@eressea.de", "de")
|
||||||
|
|
|
@ -8,6 +8,22 @@ function setup()
|
||||||
eressea.settings.set("NewbieImmunity", "0")
|
eressea.settings.set("NewbieImmunity", "0")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_water_of_life()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
r.name = "Fountain of Life"
|
||||||
|
local f = faction.create("human")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
local trees = r:get_resource('tree')
|
||||||
|
u:add_item('p2', 1)
|
||||||
|
u:add_item('log', 10)
|
||||||
|
u:add_order("BENUTZE 1 'Wasser des Lebens'")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(0, u:get_item('p2'))
|
||||||
|
assert_equal(5, u:get_item('log'))
|
||||||
|
process_orders()
|
||||||
|
assert_equal(trees+5, r:get_resource('tree'))
|
||||||
|
end
|
||||||
|
|
||||||
function test_give_horses()
|
function test_give_horses()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
local f = faction.create("human", "noreply@eressea.de", "de")
|
local f = faction.create("human", "noreply@eressea.de", "de")
|
||||||
|
|
Loading…
Reference in a new issue