content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 05:06:02 GMT 2024
   */
  
  package net.sf.lavalamp.device;
  
  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 net.sf.lavalamp.device.TimeOfDay;
  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 TimeOfDay_ESTest extends TimeOfDay_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMinutesReturningZero() throws Throwable  {
        // Given a TimeOfDay object with an invalid hour (-1844) and minute 0
        TimeOfDay timeOfDay = new TimeOfDay((-1844), 0);
        
        // When the getHours method is called
        Integer hours = timeOfDay.getHours();
        
        // Then the hour should be set to -1844 (casted as an integer)
        assertEquals((-1844), (int)hours);
        
        // When the getMinutes method is called
        Integer minutes = timeOfDay.getMinutes();
        
        // Then the minute should be 0 (casted as an integer)
        assertEquals(0, (int)minutes);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMinutesReturningNegative() throws Throwable  {
        // Create a new TimeOfDay object with an invalid value for the hour (-1023)
        TimeOfDay timeOfDay = new TimeOfDay(0, -1023);
        
        // Get the minutes part of the TimeOfDay object
        Integer minutes = timeOfDay.getMinutes();
        
        // Assert that the value for the minutes is equal to the invalid value
        assertEquals((-1023), (int)minutes);
        
        // Assert that the value for the hours is equal to 0
        assertEquals(0, (int)timeOfDay.getHours());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetHoursReturningPositive() throws Throwable  {
        // Given a time of day with a specific hour and minute value
        TimeOfDay timeOfDay = new TimeOfDay(400, 400);
        
        // When we call the getHours method
        Integer hours = timeOfDay.getHours();
        
        // Then we should get back the correct hour value
        assertEquals(400, (int)timeOfDay.getMinutes());
        assertEquals(400, (int)hours);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetHoursReturningNegative() throws Throwable  {
        // Given a negative time of day
        TimeOfDay timeOfDay = new TimeOfDay(-2770, -2770);
        
        // When we get the hours and minutes
        Integer hours = timeOfDay.getHours();
        Integer minutes = timeOfDay.getMinutes();
        
        // Then the hours should be equal to the negative value
        assertEquals(-2770, (int)hours);
        
        // And the minutes should be equal to the negative value
        assertEquals(-2770, (int)minutes);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareToReturningPositive() throws Throwable  {
        // Given two TimeOfDay objects with different minutes but same hour
        TimeOfDay timeOfDay = new TimeOfDay(0, (-1023));
        TimeOfDay arg0 = new TimeOfDay(0, (-1073));
        
        // When we compare the two objects using the compareTo method
        int compareTo = timeOfDay.compareTo(arg0);
        
        // Then we expect the result to be 1 because the first object has a lower minute value
        assertEquals(1, compareTo);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningTrue() throws Throwable  {
        // Given a TimeOfDay object with hours = 0 and minutes = -1023
        TimeOfDay timeOfDay = new TimeOfDay(0, (-1023));
        
        // When the equals method is called on this object with another TimeOfDay object with the same hours and minutes
        boolean equals = timeOfDay.equals(new TimeOfDay(0, (-1023)));
        
        // Then the result should be true, since both objects have the same values for hours and minutes
        assertTrue(equals);
        
        // And the getHours method should return 0
        assertEquals(0, (int)timeOfDay.getHours());
        
        // And the getMinutes method should return -1023
        assertEquals((-1023), (int)timeOfDay.getMinutes());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsReturningFalse() throws Throwable  {
        // Create two different TimeOfDay objects with the same values
        TimeOfDay timeOfDay = new TimeOfDay(0, (-1023));
        TimeOfDay arg0 = new TimeOfDay((-1023), (-3837));
        
        // Verify that they are not equal using the equals method
        boolean equals = timeOfDay.equals(arg0);
        assertFalse(equals);
        
        // Verify that the minutes and hours of arg0 are correct
        assertEquals((-3837), (int)arg0.getMinutes());
        assertEquals((-1023), (int)arg0.getHours());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTimeOfDayTakingString() throws Throwable  {
        // rollbacked to evosuite
        TimeOfDay timeOfDay = new TimeOfDay((-1), 100);
        TimeOfDay arg0 = new TimeOfDay("-1:100");
        boolean equals = timeOfDay.equals(arg0);
        assertEquals((-1), (int)timeOfDay.getHours());
        assertEquals(10, (int)arg0.getMinutes());
        assertEquals((-1), (int)arg0.getHours());
        assertFalse(equals);
        assertEquals(100, (int)timeOfDay.getMinutes());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNonNull() throws Throwable  {
        // This test is checking that the TimeOfDay equals method returns false when compared to an object of a different type.
        // It also checks that the getMinutes and getHours methods return the expected values for a TimeOfDay with negative hours.
        
        TimeOfDay timeOfDay = new TimeOfDay((-1), 100);
        Object arg0 = new Object();
        boolean equals = timeOfDay.equals(arg0);
        assertEquals(100, (int)timeOfDay.getMinutes());
        assertEquals((-1), (int)timeOfDay.getHours());
        assertFalse(equals); // Since the arg0 object is not a TimeOfDay, this should return false
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesTimeOfDayTaking2Arguments() throws Throwable  {
        // Given a TimeOfDay object with hours = 0 and minutes = -1023
        TimeOfDay arg0 = new TimeOfDay(0, (-1023));
        
        // When the equals method is called on the TimeOfDay object with itself as an argument
        boolean equals = arg0.equals(arg0);
        
        // Then the result should be true
        assertTrue(equals);
        
        // And the minutes of the TimeOfDay object should be -1023
        assertEquals((-1023), (int)arg0.getMinutes());
        
        // And the hours of the TimeOfDay object should be 0
        assertEquals(0, (int)arg0.getHours());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEqualsWithNull() throws Throwable  {
        // Test the equals() method with a null object
        TimeOfDay timeOfDay = new TimeOfDay((-2770), (-2770));
        boolean equals = timeOfDay.equals(null); // Check if the object is equal to null
        assertEquals((-2770), (int)timeOfDay.getHours()); // Assert that the hours are equal
        assertEquals((-2770), (int)timeOfDay.getMinutes()); // Assert that the minutes are equal
        assertFalse(equals); // Assert that the object is not equal to null
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareToReturningNegative() throws Throwable  {
        // Given two time of day objects with different values
        TimeOfDay timeOfDay = new TimeOfDay(-1023, -1023);
        TimeOfDay arg0 = new TimeOfDay(-579, -1023);
        
        // When we compare them using the compareTo method
        int compareTo = timeOfDay.compareTo(arg0);
        
        // Then we expect a negative result (since timeOfDay is before arg0)
        assertEquals(-1023, (int)timeOfDay.getHours());
        assertEquals(-1023, (int)arg0.getMinutes());
        assertEquals(-1, compareTo);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCompareToReturningZero() throws Throwable  {
        // Create a new TimeOfDay object with negative values for hours and minutes
        TimeOfDay arg0 = new TimeOfDay((-1023), (-1023));
        
        // Call the compareTo method on the created TimeOfDay object with itself as an argument
        int compareTo = arg0.compareTo(arg0);
        
        // Assert that the compareTo method returns 0, indicating that the two objects are equal
        assertEquals(0, compareTo);
        
        // Assert that the getMinutes method of the TimeOfDay object returns -1023
        assertEquals((-1023), (int)arg0.getMinutes());
        
        // Assert that the getHours method of the TimeOfDay object returns -1023
        assertEquals((-1023), (int)arg0.getHours());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        // Given a TimeOfDay object with negative hours and minutes
        TimeOfDay timeOfDay = new TimeOfDay(-1, 100);
        
        // When the toString method is called on the object
        String string = timeOfDay.toString();
        
        // Then the result should be "-1:100"
        assertEquals("-1:100", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetHoursReturningZero() throws Throwable  {
        // Given a TimeOfDay object with a negative minute value
        TimeOfDay timeOfDay = new TimeOfDay(0, -1023);
        
        // When we call getHours on the object
        Integer hours = timeOfDay.getHours();
        
        // Then we expect to get 0 as the hour value
        assertEquals(0, (int)hours);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetMinutesReturningPositive() throws Throwable  {
        // Given: A TimeOfDay object with invalid hours and minutes values
        TimeOfDay timeOfDay = new TimeOfDay(-1, 100);
        
        // When: We call the getMinutes() method on this object
        Integer minutes = timeOfDay.getMinutes();
        
        // Then: The result should be the correct number of minutes (100)
        assertEquals(100, (int)minutes);
        
        // And: The hours value should be -1 (i.e., invalid)
        assertEquals(-1, (int)timeOfDay.getHours());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testHashCode() throws Throwable  {
        // Given a TimeOfDay object with hours and minutes values
        TimeOfDay timeOfDay = new TimeOfDay(-1, 100);
        
        // When the hashCode method is called on this object
        int hashCode = timeOfDay.hashCode();
        
        // Then the return value should be based on the minutes value of the object
        assertEquals(100, (int)timeOfDay.getMinutes());
        
        // And the hours value of the object should not be taken into account when calculating the hash code
        assertEquals((-1), (int)timeOfDay.getHours());
    }
  }
  