Stendhal Quest Testing: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Kymara
No edit summary
imported>Kymara
Line 127: Line 127:
Run As ...
Run As ...
Junit test
Junit test

{{TODO|I think this needs more explanation}}


It will fail, don't worry!
It will fail, don't worry!
Line 137: Line 139:
assertEquals("SHHH! Don't want all n' sundry knowin' wot I #deal in.", getReply(npc));
assertEquals("SHHH! Don't want all n' sundry knowin' wot I #deal in.", getReply(npc));


Once all those are fixed the next error is another unexpected response:
Once all those are fixed we try running the test again. The next error is another unexpected response:
<pre>
<pre>
org.junit.ComparisonFailure: expected:<[Nosy, aint yer? I deal in rainbow beans. You take some, and who knows where the trip will take yer. It'll cost you 2000 money. You want to buy some?]> but was:<[It's not stuff you're ready for, pal. Now get out of 'ere! An don't you come back till you've got more hairs on that chest!]>
org.junit.ComparisonFailure: expected:<[Nosy, aint yer? I deal in rainbow beans. You take some, and who knows where the trip will take yer. It'll cost you 2000 money. You want to buy some?]> but was:<[It's not stuff you're ready for, pal. Now get out of 'ere! An don't you come back till you've got more hairs on that chest!]>
Line 158: Line 160:
The next error is that we don't have the money to pay for the beans. So, after saying "yes" we want the beans, we need to give the money.
The next error is that we don't have the money to pay for the beans. So, after saying "yes" we want the beans, we need to give the money.
<source lang = "java">
<source lang = "java">
PlayerTestHelper.equipWithMoney(player, 2000);
PlayerTestHelper.equipWithMoney(player, 2000);
</source>
</source>

== Trouble shooting ==
== Trouble shooting ==
java games.stendhal.tools.test.ChatTestCreator chatlog.txt [chatlogtest.java]
java games.stendhal.tools.test.ChatTestCreator chatlog.txt [chatlogtest.java]