From: Martin F. <mar...@us...> - 2008-05-14 19:58:11
|
Update of /cvsroot/arianne/stendhal/tests/games/stendhal/server/maps/quests In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv1888/tests/games/stendhal/server/maps/quests Modified Files: SellingTest.java Log Message: add tests for trying to sell 0 or less items Index: SellingTest.java =================================================================== RCS file: /cvsroot/arianne/stendhal/tests/games/stendhal/server/maps/quests/SellingTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SellingTest.java 27 Jan 2008 19:25:02 -0000 1.11 --- SellingTest.java 14 May 2008 19:58:13 -0000 1.12 *************** *** 98,101 **** --- 98,111 ---- assertTrue(player.isEquipped("cheese", 2)); assertFalse(player.isEquipped("cheese", 3)); + + // test what happens when trying to sell nothing + assertTrue(en.step(player, "sell 0 cheese")); + assertEquals("Sorry, how many pieces of cheese do you want to sell?!", npc.get("text")); + assertFalse(en.step(player, "yes")); + + // test what happens when trying to sell even less than nothing + assertTrue(en.step(player, "sell -5 cheese")); + assertEquals("Sorry, I did not understand you. negative amount: -5", npc.get("text")); + assertFalse(en.step(player, "yes")); } |