Unit Testing: Difference between revisions
Testing with ItemStacks
Tag: Undo |
(Testing with ItemStacks) |
||
Line 44:
In most IDEs you should be able to right click on the test source folder or your test class to run them directly.
== Writing unit tests ==
=== Dealing with ItemStacks ===
Need to test simple handling of ItemStacks? You can't use the game's regular item registry without loading into class loading issues, but you can get a lot done by creating your own Item and ItemStack instances in your test context:<syntaxhighlight lang="java" line="1">
ItemStack ITEMSTACK = new ItemStack(new Item());
</syntaxhighlight>
|