Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

takeItem in TestClass with Printlns

By: ace on Aug 25th, 2010  |  syntax: None  |  size: 0.81 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public String testTakeItem()
  2.     {
  3. System.out.println("TEST START");
  4.         // put your code here"
  5.        room1.setItems(item1);
  6. System.out.println(room1.roomContents());
  7.        player1.setCurrentRoom(room1);
  8. System.out.println(       player1.takeItem("item1"));
  9.         if ((player1.checkInventory().equals ("testItem")))
  10.         { System.out.println("CheckInventory OK " + player1.checkInventory());
  11.         if (player1.getEncumberance() == item1.getItemWeight())
  12.           {
  13.             System.out.println("Encumberance OK " + player1.getEncumberance());
  14.             return "test passes";
  15.           }}
  16.         else
  17.         {
  18. System.out.println(player1.checkInventory());
  19. System.out.println(player1.getEncumberance());
  20.             return "test fails";
  21.         }
  22.         return "checkInventory failed";
  23.     }