Class BoardTest

java.lang.Object
it.polimi.ingsw.Server.Model.BoardTest

public class BoardTest extends Object
Test of Board class
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) Board
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    checks if boardCards() returns the correct List of cards
    (package private) void
    Verifies that initialization of unusable, three and for dots spaces is done as expected and checks for every possible space.
    (package private) boolean
    CorrespondingListChecker(List<Integer> l1, List<Integer> l2, int x, int y)
    Checks for couple matches on 2 given Integer lists.
    (package private) void
    Empties the board and checks for limit reachability and management in generation of new Object Cards in end game conditions
    (package private) void
    Verifies that initialization creates a non-empty board
    (package private) void
    Checks if invalid moves are correctly recognized
    (package private) void
    JSON Serialization Test
    (package private) void
    Tests System.out of the Board, after each test
    (package private) void
    Last taken cards restore test

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BoardTest

      public BoardTest()
  • Method Details

    • initialize

      @Test void initialize()
      Verifies that initialization creates a non-empty board
    • CorrespondingListChecker

      boolean CorrespondingListChecker(List<Integer> l1, List<Integer> l2, int x, int y) throws Exception
      Checks for couple matches on 2 given Integer lists.
      Parameters:
      l1 - list 1
      l2 - list 2
      x - coordinate
      y - coordinate
      Returns:
      true if x and y are contained in first and second list respectively, in the same position
      Throws:
      Exception - when list sizes are different
    • correctSpaces

      @Test void correctSpaces()
      Verifies that initialization of unusable, three and for dots spaces is done as expected and checks for every possible space.
    • checkBoardCards

      @Test void checkBoardCards()
      checks if boardCards() returns the correct List of cards
    • invalidMoves

      @Test void invalidMoves() throws Exception
      Checks if invalid moves are correctly recognized
      Throws:
      Exception
    • emptyBoard

      @Test void emptyBoard() throws Exception
      Empties the board and checks for limit reachability and management in generation of new Object Cards in end game conditions
      Throws:
      Exception
    • restore

      @Test void restore() throws Exception
      Last taken cards restore test
      Throws:
      Exception
    • JSONSerialization

      @Test void JSONSerialization() throws Exception
      JSON Serialization Test
      Throws:
      Exception - related to Model Management
    • outBoard

      @AfterEach void outBoard() throws RemoteException
      Tests System.out of the Board, after each test
      Throws:
      RemoteException