View Single Post
Old 04-26-2019, 11:19 AM   #42
Fuhrmanator
 
Fuhrmanator's Avatar
 
Join Date: Aug 2007
Default Re: TFT Helper - beta test of app

The bug with carrying over dx penalty still exists. See the proof below.

It's never too late for unit tests! I wrote a bunch for melee before, but probably not in the language you're using? If the app is free, you can consider open sourcing the code?

http://i.imgur.com/PZzCAM2.jpg

Edit: here's some source for a sample unit-test (hope you can get the idea) that asserts that no dx penalty occurs at the start of the round, that it exists after the hero takes 5 hits, and that it persists for at least an entire round:

dexPenaltyLastsOneCompleteRound: function (o) {
assert(o.hero.sufferingDexPenalty()).not();
o.hero.takeHits(5);
assert(o.hero.sufferingDexPenalty());
o.hero.newRound();
assert(o.hero.damageTakenThisRound()).equals(0);
assert(o.hero.sufferingDexPenalty());
o.hero.newRound();
assert(o.hero.sufferingDexPenalty()).not();
},

Last edited by Fuhrmanator; 04-28-2019 at 02:40 PM. Reason: Show a sample unit test
Fuhrmanator is offline   Reply With Quote