content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 02:21:07 GMT 2024
   */
  
  package org.templateit;
  
  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 org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.junit.runner.RunWith;
  import org.templateit.Reference;
  import org.templateit.Region;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class Region_ESTest extends Region_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testStartReturningReferenceWhereRowIsNegative() throws Throwable  {
        // Given a Region instance with a null start reference
        Region region = new Region();
        
        // When the setStartReference method is called with a non-null Reference argument
        Reference arg0 = new Reference(-1, 587);
        region.setStartReference(arg0);
        
        // Then the start reference of the Region should be updated to the given Reference
        assertSame(region.start(), arg0);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testStartReturningReferenceWhereColumnIsZero() throws Throwable  {
        // Setup
        Reference arg1 = new Reference(0, 0);
        Region region = new Region(arg1, arg1);
        
        // Execute
        Reference start = region.start();
        
        // Verify
        assertSame(arg1, start);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testStartReturningReferenceWhereColumnIsNegative() throws Throwable  {
        // Given a Region object and a Reference object with row -1
        Region region = new Region();
        Reference arg0 = new Reference(0, (-1));
        
        // When the start Reference is set to the given Reference object
        region.setStartReference(arg0);
        
        // Then the start Reference should be equal to the given Reference object
        assertEquals(arg0, region.start());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEndReturningReferenceWhereRowIsNegative() throws Throwable  {
        // Arrange
        Reference arg1 = new Reference(0, 0);
        Region region = new Region(arg1, arg1);
        Reference arg0 = new Reference((-568), 0);
        
        // Act
        region.setEndReference(arg0);
        Reference end = region.end();
        
        // Assert
        assertNotSame(arg1, end);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEnd() throws Throwable  {
        // Test that the end of an empty region is at (0, 0)
        Reference arg1 = new Reference(0, 0);
        Region region = new Region(arg1, arg1);
        Reference end = region.end();
        assertEquals(0, end.row());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEndReturningReferenceWhereColumnIsNegative() throws Throwable  {
        // Given: A new Region object and a Reference object with column -1
        Region region = new Region();
        Reference arg0 = new Reference(0, (-1));
        
        // When: The end reference of the Region is set to the Reference object
        region.setEndReference(arg0);
        
        // Then: The end reference of the Region should be equal to the Reference object with column -1
        assertEquals((-1), region.end().column());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsTakingReferenceWithReferenceWhereRowIsPositive() throws Throwable  {
        // Given
        Region region = new Region();
        Reference startReference = new Reference(1, 1);
        region.setStartReference(startReference);
        region.setEndReference(startReference);
        
        // When
        boolean contains = region.contains(startReference);
        
        // Then
        assertTrue(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsTakingReferenceWithReferenceWhereColumnIsNegative() throws Throwable  {
        // Given: A Reference object with coordinates (-1, -1) and a Region object initialized with the same reference as its boundaries.
        Reference arg0 = new Reference(-1, -1);
        Region region = new Region(arg0, arg0);
        
        // When: The method contains is called with the same reference as an argument.
        boolean contains = region.contains(arg0);
        
        // Then: The method should return true because the reference is within the boundaries of the region.
        assertTrue(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsTakingReferenceReturningFalse() throws Throwable  {
        // Arrange
        Reference arg1 = new Reference(0, 0);
        Region region = new Region(arg1, arg1);
        Reference arg0 = new Reference((-568), 0);
        
        // Act
        boolean contains = region.contains(arg0);
        
        // Assert
        assertFalse(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsTakingRegionReturningTrue() throws Throwable  {
        // Given a Region with two references that point to the same location
        Reference ref = new Reference(0, (-739));
        Region region = new Region(ref, ref);
        
        // When checking if the region contains itself
        boolean contains = region.contains(region);
        
        // Then it should return true
        assertTrue(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToString() throws Throwable  {
        // Given
        Reference arg1 = new Reference(0, (-739));
        Region region = new Region(arg1, arg1);
        
        // When
        String string = region.toString();
        
        // Then
        assertEquals("0,-739,0,-739", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testStartReturningNull() throws Throwable  {
        // Given: The region is a valid instance of Region class
        // When: We call the start() method on the region object
        // Then: The start reference should be null
        Region region = new Region();
        Reference start = region.start();
        assertNull(start);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testContainsTakingRegionWithNonNull() throws Throwable  {
        // No Comments were added
        Reference arg1 = new Reference((-1), (-1));
        Region arg0 = new Region(arg1, arg1);
        boolean contains = arg0.contains(arg0);
        assertTrue(contains);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testEndReturningNull() throws Throwable  {
        // Given an empty region object
        Region region = new Region();
        
        // When the end method is called on the region object
        Reference end = region.end();
        
        // Then the end reference should be null
        assertNull(end);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testStartReturningReferenceWhereRowIsPositive() throws Throwable  {
        Region region = new Region();
        // Create a Reference object with an ID of 587 and a start position of 587
        Reference arg0 = new Reference(587, 587);
        region.setStartReference(arg0);
        
        // Call the setStartReference method on the region to set the start reference to the given reference object
        region.setStartReference(arg0);
        
        // Call the start() method on the region to get the start reference of the region
        Reference start = region.start();
        
        // Verify that the start reference is the same as the given reference object
        assertSame(start, arg0);
    }
  }
  