content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 01:57:57 GMT 2024
   */
  
  package lotus.core;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import lotus.UI.console.LocalConsoleUserInterface;
  import lotus.core.CardCollection;
  import lotus.core.Game;
  import lotus.core.Player;
  import lotus.core.card.Card;
  import lotus.core.card.Instant;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class Game_ESTest extends Game_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGivePriorityToCurrentPlayerThrowsNullPointerException() throws Throwable  {
        // Test that givePriorityToCurrentPlayer throws a NullPointerException when the current player is null
        try {
        Game.givePriorityToCurrentPlayer();
        fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        //
        // Verify that the exception has no message (getMessage() returned null)
        //
        verifyException("lotus.core.Game", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetOtherPlayerReturningNull() throws Throwable  {
        // Test that the method returns null when passed a null player
        Player otherPlayer = Game.getOtherPlayer((Player) null);
        assertNull(otherPlayer);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPlayingPlayerReturningNonNull() throws Throwable  {
        // Given: The LocalConsoleUserInterface and the CardCollection are set up
        LocalConsoleUserInterface ui = new LocalConsoleUserInterface();
        CardCollection library = new CardCollection();
        Game.init(ui, ui, "", "WftGQ", library, library);
        
        // When: The game is initialized with the LocalConsoleUserInterface and CardCollection
        Game.init(ui, ui, "", "WftGQ", library, library);
        
        // Then: The playingPlayer has not tried to draw from an empty library yet
        Player playingPlayer = Game.getPlayingPlayer();
        assertFalse(playingPlayer.triedToDrawFromEmptyLibrary);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetPlayingPlayerReturningNull() throws Throwable  {
        // Test that a player is not present in the game when no players have joined yet
        Player playingPlayer = Game.getPlayingPlayer();
        assertNull(playingPlayer);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testInitWithNonEmptyListAndNonEmptyList() throws Throwable  {
        // Given
        LocalConsoleUserInterface userInterface = new LocalConsoleUserInterface();
        CardCollection cardCollection = new CardCollection();
        Instant instant = new Instant();
        
        // When
        cardCollection.add(instant);
        Game.init(userInterface, userInterface, "", "WftGQ", cardCollection, cardCollection);
        
        // Then
        assertEquals(1, cardCollection.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetOtherPlayerReturningNonNull() throws Throwable  {
        // Given a player with an empty library
        LocalConsoleUserInterface ui = new LocalConsoleUserInterface();
        CardCollection library = new CardCollection();
        Game.init(ui, ui, "", "WftGQ", library, library);
        
        // When the player tries to draw a card
        Player otherPlayer = Game.getOtherPlayer((Player) null);
        assertFalse(otherPlayer.triedToDrawFromEmptyLibrary);
        
        // Then no cards are drawn and the player's triedToDrawFromEmptyLibrary flag is set to true
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNonPlayingPlayerReturningNonNull() throws Throwable  {
        // Given: A LocalConsoleUserInterface and a CardCollection for the game
        LocalConsoleUserInterface ui = new LocalConsoleUserInterface();
        CardCollection deck = new CardCollection();
        
        // When: Initializing the game with the UI, players, and deck
        Game.init(ui, ui, "The Deck of Many Things", "WftGQ", deck, deck);
        
        // Then: Verify that the non-playing player has 20 life
        Player nonPlayingPlayer = Game.getNonPlayingPlayer();
        assertEquals(20, nonPlayingPlayer.life);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesGame() throws Throwable  {
        // Given a new game object is created
        Game game = new Game();
        
        // When the playing player is initialized
        int playingPlayer = Game.playingPlayer;
        
        // Then the playing player should be 0 (i.e., no player has started)
        assertEquals(0, playingPlayer);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNonPlayingPlayerReturningNull() throws Throwable  {
        Player nonPlayingPlayer = Game.getNonPlayingPlayer();
        
        // When: The player is retrieved from the game
        Player retrievedPlayer = Game.getNonPlayingPlayer();
        
        // Then: The retrieved player should be null
        assertNull(retrievedPlayer);
    }
  }
  