content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 09:05:47 GMT 2024
   */
  
  package net.virtualinfinity.atrobots.gui.renderers;
  
  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.shaded.org.mockito.Mockito.*;
  import static org.evosuite.runtime.EvoAssertions.*;
  import java.awt.Graphics2D;
  import java.awt.Stroke;
  import java.util.LinkedHashSet;
  import java.util.Set;
  import net.virtualinfinity.atrobots.gui.renderers.RobotRenderer;
  import net.virtualinfinity.atrobots.snapshots.RobotSnapshot;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.ViolatedAssumptionAnswer;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class RobotRenderer_ESTest extends RobotRenderer_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetShowStatusBars() throws Throwable  {
        // Given a RobotRenderer instance with showStatusBars set to true
        RobotRenderer robotRenderer = new RobotRenderer();
        robotRenderer.setShowStatusBars(true);
        
        // When the showStatusBars property is set to false
        robotRenderer.setShowStatusBars(false);
        
        // Then the showStatusBars property should be false
        assertFalse(robotRenderer.isShowStatusBars());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetShowName() throws Throwable  {
        // Given
        RobotRenderer robotRenderer = new RobotRenderer();
        assertTrue(robotRenderer.isShowName());
        
        // When
        robotRenderer.setShowName(false);
        
        // Then
        boolean showName = robotRenderer.isShowName();
        assertFalse(showName);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsRenderDeadReturningTrue() throws Throwable  {
        // Given
        RobotRenderer robotRenderer = new RobotRenderer();
        
        // When
        boolean renderDead = robotRenderer.isRenderDead();
        
        // Then
        assertTrue(renderDead);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderWithRobotSnapshotWhereIsDeadIsTrue() throws Throwable  {
        // No Comments were added
        RobotRenderer robotRenderer = new RobotRenderer();
        Graphics2D arg0 = mock(Graphics2D.class, new ViolatedAssumptionAnswer());
        doReturn((Stroke) null).when(arg0).getStroke();
        RobotSnapshot arg1 = new RobotSnapshot();
        arg1.setDead(true);
        LinkedHashSet<Integer> arg2 = new LinkedHashSet<Integer>();
        // Undeclared exception!
        try { 
          robotRenderer.render(arg0, arg1, (Set<Integer>) arg2);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("net.virtualinfinity.atrobots.snapshots.ArenaObjectSnapshot", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRender() throws Throwable  {
        // Given a RobotRenderer instance with renderDead set to true
        RobotRenderer robotRenderer = new RobotRenderer();
        robotRenderer.setRenderDead(true);
        
        // When rendering a robot with dead state
        RobotSnapshot arg1 = new RobotSnapshot();
        arg1.setDead(true);
        robotRenderer.render((Graphics2D) null, arg1, (Set<Integer>) null);
        
        // Then the fillShield property is set to true
        assertTrue(robotRenderer.isFillShield());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetRenderDead() throws Throwable  {
        // No Comments were added
        RobotRenderer robotRenderer = new RobotRenderer();
        RobotSnapshot arg1 = new RobotSnapshot();
        robotRenderer.setRenderDead(false);
        // Undeclared exception!
        try { 
          robotRenderer.render((Graphics2D) null, arg1, (Set<Integer>) null);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("net.virtualinfinity.atrobots.gui.renderers.RobotRenderer", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsFillShieldReturningTrue() throws Throwable  {
        // Given a RobotRenderer instance with default settings
        RobotRenderer robotRenderer = new RobotRenderer();
        
        // When the renderer's fillShield property is queried
        boolean fillShield = robotRenderer.isFillShield();
        
        // Then the fillShield property should be true
        assertTrue(fillShield);
        
        // Given that the renderer is set to render dead robots
        robotRenderer.setRenderDead(true);
        
        // When the renderer's showName property is queried
        boolean showName = robotRenderer.isShowName();
        
        // Then the showName property should be true
        assertTrue(showName);
        
        // Given that the renderer is set to show status bars for dead robots
        robotRenderer.setShowStatusBars(true);
        
        // When the renderer's showStatusBars property is queried
        boolean showStatusBars = robotRenderer.isShowStatusBars();
        
        // Then the showStatusBars property should be true
        assertTrue(showStatusBars);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsRenderDeadReturningFalse() throws Throwable  {
        // Given a RobotRenderer instance with the default settings
        RobotRenderer robotRenderer = new RobotRenderer();
        
        // When the render dead status is queried
        boolean initialRenderDeadStatus = robotRenderer.isRenderDead();
        
        // Then the initial render dead status should be true
        assertTrue(initialRenderDeadStatus);
        
        // When the render dead status is set to false
        robotRenderer.setRenderDead(false);
        
        // Then the render dead status should be false
        boolean updatedRenderDeadStatus = robotRenderer.isRenderDead();
        assertFalse(updatedRenderDeadStatus);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsShowStatusBarsReturningTrue() throws Throwable  {
        // Create a new instance of the RobotRenderer class
        RobotRenderer robotRenderer = new RobotRenderer();
        
        // Test that the renderer is set to dead
        assertTrue(robotRenderer.isRenderDead());
        
        // Test that the name of the robot is shown
        assertTrue(robotRenderer.isShowName());
        
        // Test that the status bars are shown
        boolean showStatusBars = robotRenderer.isShowStatusBars();
        assertTrue(showStatusBars);
        
        // Test that the shield is filled
        assertTrue(robotRenderer.isFillShield());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetFillShield() throws Throwable  {
        // Given: A RobotRenderer object is created and the fillShield property is set to true
        RobotRenderer robotRenderer = new RobotRenderer();
        robotRenderer.setFillShield(true);
        
        // When: The fillShield property is set to false
        robotRenderer.setFillShield(false);
        
        // Then: The fillShield property should be set to false and the getFillShield method should return false
        boolean fillShield = robotRenderer.isFillShield();
        assertFalse(fillShield);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRenderThrowsNullPointerException() throws Throwable  {
        RobotRenderer robotRenderer = new RobotRenderer(); // Create a new instance of the RobotRenderer class
        Graphics2D arg0 = mock(Graphics2D.class, new ViolatedAssumptionAnswer()); // Mock a Graphics2D object and use the ViolatedAssumptionAnswer to throw a NullPointerException when the getStroke() method is called
        doReturn((Stroke) null).when(arg0).getStroke(); // Set the stroke of the Graphics2D object to null, this will cause the render() method to throw a NullPointerException
        RobotSnapshot arg1 = new RobotSnapshot(); // Create a new instance of the RobotSnapshot class
        LinkedHashSet<Integer> arg2 = new LinkedHashSet<Integer>(); // Create a new instance of the LinkedHashSet class and populate it with some data
        try {
        robotRenderer.render(arg0, arg1, (Set<Integer>) arg2); // Call the render() method on the RobotRenderer object, passing in the Graphics2D object, RobotSnapshot object, and Set of Integers as arguments
        fail("Expecting exception: NullPointerException"); // If no exception is thrown, this line will fail the test
        } catch(NullPointerException e) {
        // Verify that the correct type of exception was thrown
        verifyException("net.virtualinfinity.atrobots.snapshots.ArenaObjectSnapshot", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsShowNameReturningTrue() throws Throwable  {
        // Given a RobotRenderer object with default settings
        RobotRenderer robotRenderer = new RobotRenderer();
        
        // When the showName property is accessed
        boolean showName = robotRenderer.isShowName();
        
        // Then the value of showName should be true
        assertTrue(showName);
        
        // And the other properties should also have default values
        assertTrue(robotRenderer.isRenderDead());
        assertTrue(robotRenderer.isFillShield());
        assertTrue(robotRenderer.isShowStatusBars());
    }
  }
  