content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 07:10:12 GMT 2024
   */
  
  package de.outstare.fortbattleplayer.statistics;
  
  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 de.outstare.fortbattleplayer.model.Area;
  import de.outstare.fortbattleplayer.model.Combatant;
  import de.outstare.fortbattleplayer.model.CombatantSide;
  import de.outstare.fortbattleplayer.statistics.AreaStatistic;
  import de.outstare.fortbattleplayer.statistics.BattleStatistics;
  import de.outstare.fortbattleplayer.statistics.CriticalHit;
  import de.outstare.fortbattleplayer.statistics.LabeledData;
  import de.outstare.fortbattleplayer.statistics.PositionSwitch;
  import de.outstare.fortbattleplayer.statistics.WeaponModCounter;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
  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 BattleStatistics_ESTest extends BattleStatistics_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRoundReturningPositive() throws Throwable  {
        // Given: a BattleStatistics object with a total of 307 battles
        BattleStatistics battleStatistics = new BattleStatistics(307, 307);
        
        // When: calling the round method with the total number of battles as an argument
        int round = battleStatistics.round(307);
        
        // Then: the result should be the same as the total number of battles
        assertEquals(307, round);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRoundReturningNegative() throws Throwable  {
        // Given a BattleStatistics object with a round count of 4 and an accumulated damage value of -2575
        BattleStatistics battleStatistics = new BattleStatistics(4, (-2575));
        
        // When the round method is called with the same accumulated damage value as the BattleStatistics object
        int round = battleStatistics.round((-2575));
        
        // Then the method should return the same accumulated damage value as the BattleStatistics object
        assertEquals((-2575), round);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCountWeaponMods() throws Throwable  {
        // Given: A BattleStatistics object with a negative damage value and a CombatantSide.DEFENDER parameter
        BattleStatistics battleStatistics = new BattleStatistics(-190, 124);
        CombatantSide arg0 = CombatantSide.DEFENDER;
        
        // When: Calling the countWeaponMods method with the CombatantSide.DEFENDER and a WeaponModCounter.BayonetCounter object as parameters
        int countWeaponMods = battleStatistics.countWeaponMods(arg0, new WeaponModCounter.BayonetCounter());
        
        // Then: The method should return 0 because the damage value is negative and the CombatantSide is DEFENDER
        assertEquals(0, countWeaponMods);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCritListWithNonNull() throws Throwable  {
        BattleStatistics battleStatistics = new BattleStatistics(634, 634);
        CombatantSide arg0 = CombatantSide.DEFENDER;
        List<CriticalHit> critList = battleStatistics.critList(arg0);
        
        // Given: a BattleStatistics instance with a total number of 634 attacks and 634 hits
        // When: the critList method is called with CombatantSide.DEFENDER as an argument
        // Then: the returned list should be empty
        assertTrue(critList.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNotShootersPerRound() throws Throwable  {
        // Given: There is a BattleStatistics instance with a round number of 2 and a total of 131 combatants
        BattleStatistics battleStatistics = new BattleStatistics(131, 131);
        battleStatistics.setRound(2);
        
        // When: We retrieve the not shooters per round data from the instance using the getNotShootersPerRound() method
        Map<CombatantSide, ? extends LabeledData> notShootersPerRound = battleStatistics.getNotShootersPerRound();
        
        // Then: The size of the returned map should be 2, as there are two sides with at least one combatant that did not shoot in this round
        assertEquals(2, notShootersPerRound.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCritListWithNull() throws Throwable  {
        // Given: A new BattleStatistics instance with 2698 combatants on each side
        BattleStatistics battleStatistics = new BattleStatistics(2698, 2698);
        
        // When: We call the critList method with a null CombatantSide
        List<CriticalHit> critList = battleStatistics.critList((CombatantSide) null);
        
        // Then: The critList should be empty
        assertEquals(0, critList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCriticalHitDamage() throws Throwable  {
        // Tests that the critical hit damage is 0 for a defender side.
        BattleStatistics battleStatistics = new BattleStatistics(131, 131);
        CombatantSide arg0 = CombatantSide.DEFENDER;
        long expectedCriticalHitDamage = 0L;
        long actualCriticalHitDamage = battleStatistics.criticalHitDamage(arg0);
        assertEquals(expectedCriticalHitDamage, actualCriticalHitDamage);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSwitchedPosList() throws Throwable  {
        // Given a BattleStatistics instance with a number of switches
        BattleStatistics battleStatistics = new BattleStatistics(1, 553);
        
        // When the switchedPosList method is called with null as the side argument
        Set<PositionSwitch> switchedPosList = battleStatistics.switchedPosList((CombatantSide) null);
        
        // Then the returned set should be empty
        assertEquals(0, switchedPosList.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfMovesPerPlayerReturningZero() throws Throwable  {
        // Arrange
        BattleStatistics battleStatistics = new BattleStatistics(-1734, -1734);
        CombatantSide arg0 = CombatantSide.DEFENDER;
        
        // Act
        double numberOfMovesPerPlayer = battleStatistics.numberOfMovesPerPlayer(arg0);
        
        // Assert
        assertEquals(-0.0, numberOfMovesPerPlayer, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfMovesPerPlayerWithNonNull() throws Throwable  {
        BattleStatistics battleStatistics = new BattleStatistics(40, 40);
        // Given the number of moves per player is requested for the attacker side
        CombatantSide attackerSide = CombatantSide.ATTACKER;
        double numberOfMovesPerPlayer = battleStatistics.numberOfMovesPerPlayer(attackerSide);
        // Then the number of moves per player should be zero
        assertEquals(0.0, numberOfMovesPerPlayer, 0.01);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCombatantLifetime() throws Throwable  {
        // Arrange
        BattleStatistics battleStatistics = new BattleStatistics(40, 40);
        
        // Act
        int combatantLifetime = battleStatistics.combatantLifetime(null);
        
        // Assert
        assertEquals(0, combatantLifetime);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetRoundWithNegative() throws Throwable  {
        // rollbacked to evosuite
        BattleStatistics battleStatistics = new BattleStatistics(890, 890);
        battleStatistics.setRound((-1));
        battleStatistics.setRound(890);
        battleStatistics.setRound(2);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetShotsPerRound() throws Throwable  {
        // Given: a new BattleStatistics object with zero rounds and zero shots
        BattleStatistics battleStatistics = new BattleStatistics(0, 0);
        
        // When: getting the number of shots per round from the BattleStatistics object
        Map<CombatantSide, ? extends LabeledData> shotsPerRound = battleStatistics.getShotsPerRound();
        
        // Then: the returned map should be empty since there are no rounds or shots yet
        assertTrue(shotsPerRound.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAmountOfDefenseBonus() throws Throwable  {
        // Arrange
        BattleStatistics battleStatistics = new BattleStatistics(131, 131);
        CombatantSide combatantSide = CombatantSide.DEFENDER;
        
        // Act
        int amountOfDefenseBonus = battleStatistics.amountOfDefenseBonus(combatantSide);
        
        // Assert
        assertEquals(0, amountOfDefenseBonus);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testRoundReturningZero() throws Throwable  {
        // Given a BattleStatistics object with a total number of battles of 3292
        BattleStatistics battleStatistics = new BattleStatistics(0, 3292);
        
        // When we call the round method with an input of 0
        int round = battleStatistics.round(0);
        
        // Then the method should return 0
        assertEquals(0, round);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCriticalHits() throws Throwable  {
        // Given a BattleStatistics object with 4 attackers and a defender who has been hit for -2575 damage
        BattleStatistics battleStatistics = new BattleStatistics(4, (-2575));
        
        // When the critical hits are calculated for the defender
        CombatantSide arg0 = CombatantSide.DEFENDER;
        int criticalHits = battleStatistics.criticalHits(arg0);
        
        // Then the number of critical hits is 0
        assertEquals(0, criticalHits);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetHitsPerRound() throws Throwable  {
        // Given: a BattleStatistics object with two combatants and a total of four rounds
        BattleStatistics battleStatistics = new BattleStatistics(4, (-2575));
        
        // When: retrieving the hits per round for each side
        Map<CombatantSide, ? extends LabeledData> hitsPerRound = battleStatistics.getHitsPerRound();
        
        // Then: there should be two rounds with hits for each side
        assertEquals(2, hitsPerRound.size());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHasMovedThrowsNullPointerException() throws Throwable  {
        // Given: a BattleStatistics object with two combatants and an area
        BattleStatistics battleStatistics = new BattleStatistics(1, 1);
        
        // When: the hasMoved method is called with null inputs
        try {
        battleStatistics.hasMoved(null, null);
        
        // Then: a NullPointerException should be thrown
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // Verify that the correct exception is thrown with the correct message
        verifyException("de.outstare.fortbattleplayer.statistics.AllCombatantSidesCounter", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsAlive() throws Throwable  {
        // rollbacked to evosuite
        BattleStatistics battleStatistics = new BattleStatistics(0, 0);
        battleStatistics.isAlive((Combatant) null);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfHipFlasks() throws Throwable  {
        // Given a BattleStatistics instance with the initial values of (-1705, -1705)
        BattleStatistics battleStatistics = new BattleStatistics((-1705), (-1705));
        
        // When we call the numberOfHipFlasks method for a CombatantSide.DEFENDER
        int numberOfHipFlasks = battleStatistics.numberOfHipFlasks(CombatantSide.DEFENDER);
        
        // Then the method should return 0
        assertEquals(0, numberOfHipFlasks);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfSchmierOil() throws Throwable  {
        // Test that the number of Schmier Oil cards in the defender's hand is correctly calculated
        BattleStatistics battleStatistics = new BattleStatistics(-905, -905);
        CombatantSide arg0 = CombatantSide.DEFENDER;
        int expectedNumberOfSchmierOil = 0;
        int actualNumberOfSchmierOil = battleStatistics.numberOfSchmierOil(arg0);
        assertEquals(expectedNumberOfSchmierOil, actualNumberOfSchmierOil);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfFettesOil() throws Throwable  {
        // Create a new instance of the BattleStatistics class with default values
        BattleStatistics battleStatistics = new BattleStatistics(0, 0);
        
        // Set the combatant side to DEFENDER
        CombatantSide arg0 = CombatantSide.DEFENDER;
        
        // Call the numberOfFettesOil method with the DEFENDER combatant side as argument
        int numberOfFettesOil = battleStatistics.numberOfFettesOil(arg0);
        
        // Assert that the returned value is 0
        assertEquals(0, numberOfFettesOil);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFieldStatistics() throws Throwable  {
        // rollbacked to evosuite
        BattleStatistics battleStatistics = new BattleStatistics((-1311), (-119));
        Map<Area, AreaStatistic> fieldStatistics = battleStatistics.getFieldStatistics();
        assertTrue(fieldStatistics.isEmpty());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testTotalSwaps() throws Throwable  {
        // No Comments were added
        BattleStatistics battleStatistics = new BattleStatistics((-1705), (-1705));
        int totalSwaps = battleStatistics.totalSwaps((CombatantSide) null);
        assertEquals(0, totalSwaps);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfGraphitLubricants() throws Throwable  {
        // Test that the number of graphit lubricants is 0 when the combatant side is defender and the battle statistics have a negative value for number of graphit lubricants.
        BattleStatistics battleStatistics = new BattleStatistics((-190), 124);
        CombatantSide arg0 = CombatantSide.DEFENDER;
        int numberOfGraphitLubricants = battleStatistics.numberOfGraphitLubricants(arg0);
        assertEquals(0, numberOfGraphitLubricants);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testAmountOfAttackBonus() throws Throwable  {
        // Arrange
        BattleStatistics battleStatistics = new BattleStatistics(5, 5);
        CombatantSide attacker = CombatantSide.ATTACKER;
        
        // Act
        int actualValue = battleStatistics.amountOfAttackBonus(attacker);
        
        // Assert
        assertEquals(0, actualValue);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsDead() throws Throwable  {
        // rollbacked to evosuite
        BattleStatistics battleStatistics = new BattleStatistics(4, (-2575));
        battleStatistics.isDead((Combatant) null);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfShinyOil() throws Throwable  {
        BattleStatistics battleStatistics = new BattleStatistics(-1311, -119);
        CombatantSide attackerSide = CombatantSide.ATTACKER;
        int numberOfShinyOil = battleStatistics.numberOfShinyOil(attackerSide);
        // Assert that the number of shiny oil for the attacker side is 0, since there are no shiny oil on the field.
        assertEquals(0, numberOfShinyOil);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testNumberOfBayonets() throws Throwable  {
        // Given a BattleStatistics object with 131 points on the defender side and 131 points on the attacker side
        BattleStatistics battleStatistics = new BattleStatistics(131, 131);
        
        // When we check the number of bayonets on the defender side
        CombatantSide arg0 = CombatantSide.DEFENDER;
        int numberOfBayonets = battleStatistics.numberOfBayonets(arg0);
        
        // Then we expect to receive 0 as the result
        assertEquals(0, numberOfBayonets);
    }
  }
  