content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 08:27:30 GMT 2024
   */
  
  package jigl.image.ops;
  
  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 jigl.image.ops.Shift;
  import jigl.image.types.ColorImage;
  import jigl.image.types.GrayImage;
  import jigl.image.types.ImageKernel;
  import jigl.image.types.InterpolatedColorImage;
  import jigl.image.types.InterpolatedGrayImage;
  import jigl.image.types.InterpolatedRealColorImage;
  import jigl.image.types.RealColorImage;
  import jigl.image.types.RealGrayImage;
  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 Shift_ESTest extends Shift_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealGrayImageReturningRealGrayImageWhereXIsZero() throws Throwable  {
        // Given a Shift instance with some coordinates
        Shift shift = new Shift((-692), (-692), (-692));
        
        // And a RealGrayImage instance as input
        RealGrayImage arg0 = new RealGrayImage(0, 0);
        
        // When the apply method is called with the input image
        RealGrayImage apply = shift.apply(arg0);
        
        // Then the output image should not be the same as the input image
        assertNotSame(arg0, apply);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealColorImageReturningRealColorImageWhereXIsZero() throws Throwable  {
        // Given a Shift object with negative values
        Shift shift = new Shift(-16777216, 0, 0);
        
        // And a RealColorImage with X value of 0
        InterpolatedRealColorImage image = new InterpolatedRealColorImage(0, 0);
        
        // When applying the Shift to the Image
        RealColorImage apply = shift.apply((RealColorImage) image);
        
        // Then the X value of the applied image should be 0
        assertEquals(0, apply.X());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingGrayImageReturningGrayImageWhereYIsZero() throws Throwable  {
        // Given a Shift object with the ID 1806 and a GrayImage object with a single pixel
        Shift shift = new Shift(1806, 1806, 1806);
        GrayImage arg0 = new GrayImage(1, 0);
        
        // When the apply method is called on the Shift object with the GrayImage object as an argument
        GrayImage apply = shift.apply(arg0);
        
        // Then the output of the apply method should be a GrayImage object with a single pixel
        assertEquals(0, apply.Y());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingGrayImage() throws Throwable  {
        // Given a Shift object with a time of 1800 hours and an InterpolatedGrayImage object with dimensions (1, 1)
        Shift shift = new Shift(1800, 1800, 1800);
        InterpolatedGrayImage arg0 = new InterpolatedGrayImage(1, 1);
        
        // When applying the Shift to the InterpolatedGrayImage object
        GrayImage apply = shift.apply((GrayImage) arg0);
        
        // Then assert that the X() method of the resulting GrayImage object returns 1
        assertEquals(1, apply.X());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealGrayImageReturningRealGrayImageWhereSqrSumIsPositive() throws Throwable  {
        // Test that the shift operation correctly adjusts the minimum value of an image
        Shift shift = new Shift(2749, 441, 1);
        ImageKernel arg0 = new ImageKernel(446.95F, 1);
        RealGrayImage apply = shift.apply((RealGrayImage) arg0);
        assertEquals(446.95F, apply.min(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealGrayImage() throws Throwable  {
        // Given: A shift of -3863 and a RealGrayImage with a max value of 0.0F
        Shift shift = new Shift(1, (-3863), 1);
        ImageKernel arg0 = new ImageKernel(0.0F, 1);
        
        // When: Applying the shift to the RealGrayImage
        RealGrayImage apply = shift.apply((RealGrayImage) arg0);
        
        // Then: The resulting RealGrayImage should have a max value of 0.0F
        assertEquals(0.0F, apply.max(), 0.01F);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealColorImage0() throws Throwable  {
        // Given a RealColorImage with dimensions 10x10 and a Shift instance with shift values (1, 375, 1)
        RealColorImage arg0 = new RealColorImage(10, 10);
        Shift shift = new Shift(1, 375, 1);
        
        // When the apply method is called on the shift instance with the RealColorImage as an argument
        RealColorImage apply = shift.apply(arg0);
        
        // Then the returned image should not be equal to the original image (as the image has been shifted)
        assertFalse(apply.equals((Object) arg0));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealColorImageThrowsArrayIndexOutOfBoundsException() throws Throwable  {
        // Given
        InterpolatedRealColorImage image = new InterpolatedRealColorImage(10, 10);
        Shift shift = new Shift((-1058), 10, 1);
        
        // When
        shift.apply(image);
        
        // Then
        fail("Expecting exception: ArrayIndexOutOfBoundsException");
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingRealColorImage1() throws Throwable  {
        // Create a new Shift instance with negative values for all dimensions
        Shift shift = new Shift(-17, -17, -17);
        
        // Create a new InterpolatedRealColorImage with specific dimensions and data type
        InterpolatedRealColorImage image = new InterpolatedRealColorImage(188, 1);
        
        // Apply the Shift to the InterpolatedRealColorImage
        RealColorImage result = shift.apply((RealColorImage) image);
        
        // Assert that the Y dimension of the resulting RealColorImage is equal to 1
        assertEquals(1, result.Y());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingGrayImageThrowsNullPointerException() throws Throwable  {
        // No Comments were added
        Shift shift = new Shift(8, 8, 8);
        GrayImage arg0 = new GrayImage(31, 31);
        // Undeclared exception!
        try { 
          shift.apply(arg0);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImage() throws Throwable  {
        // rollbacked to evosuite
        Shift shift = new Shift(20, 20, 20);
        InterpolatedColorImage arg0 = new InterpolatedColorImage(9990, 1);
        ColorImage apply = shift.apply((ColorImage) arg0);
        assertEquals(1, apply.Y());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageReturningColorImageWhereXIsPositive() throws Throwable  {
        // Given a Shift object with an x-coordinate of 10 and a y-coordinate of -897
        Shift shift = new Shift(10, (-897), 1360);
        
        // And a ColorImage object with an width of 525 and height of 1
        ColorImage arg0 = new ColorImage(525, 1);
        
        // When the apply method is called on the Shift object with the ColorImage object as input
        ColorImage apply = shift.apply(arg0);
        
        // Then the apply method should return a new ColorImage object that is not the same as the original ColorImage object
        assertNotSame(apply, arg0);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageThrowsNullPointerException0() throws Throwable  {
        Shift shift = new Shift((-441), 1347, 1);
        InterpolatedColorImage arg0 = new InterpolatedColorImage(1, 35);
        try {
        // Apply the shift to the image and catch any exception that may occur
        shift.apply((ColorImage) arg0);
        } catch (NullPointerException e) {
        // Catch the NullPointerException and assert that the message is null
        assertEquals(null, e.getMessage());}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageThrowsNullPointerException1() throws Throwable  {
        // Create a new shift object with some parameters
        Shift shift = new Shift(1, 1, 1);
        
        // Create a new color image with some dimensions
        ColorImage arg0 = new ColorImage(1, 1);
        
        // Try to apply the shift to the image
        try {
        shift.apply(arg0);
        fail("Expecting exception: NullPointerException");
        } catch (NullPointerException e) {
        // The expected exception was thrown, so we should handle it here
        assertEquals(e.getMessage(), "The image is null.");}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageThrowsNullPointerException2() throws Throwable  {
        // Given
        Shift shift = new Shift((-441), (-441), 1);
        InterpolatedColorImage arg0 = new InterpolatedColorImage(1, 35);
        
        // When
        shift.apply((ColorImage) arg0);
        
        // Then
        fail("Expecting exception: NullPointerException");
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingGrayImageReturningGrayImageWhereXIsZero() throws Throwable  {
        // Given a shift object and an interpolated gray image
        Shift shift = new Shift(1, 1, 1);
        InterpolatedGrayImage arg0 = new InterpolatedGrayImage(0, 1);
        
        // When the shift is applied to the image
        GrayImage apply = shift.apply((GrayImage) arg0);
        
        // Then the result of the shift should be a gray image with a Y value of 1 and an X value of 0
        assertEquals(1, apply.Y());
        assertEquals(0, apply.X());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageReturningColorImageWhereXIsZero() throws Throwable  {
        // Create a new shift with the same parameters as before
        Shift shift = new Shift(1, 1, 1);
        
        // Create a new color image with the same dimensions as the original image
        ColorImage arg0 = new ColorImage(0, 0);
        
        // Apply the shift to the color image
        ColorImage apply = shift.apply(arg0);
        
        // Assert that the returned image is not the same as the original image
        assertNotSame(apply, arg0);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageThrowsNullPointerException3() throws Throwable  {
        // No Comments were added
        Shift shift = new Shift(1, (-2272), 1);
        ColorImage arg0 = new ColorImage(16, 2);
        // Undeclared exception!
        try { 
          shift.apply(arg0);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testApplyTakingColorImageThrowsTooManyResourcesException() throws Throwable  {
        // rollbacked to evosuite
        Shift shift = new Shift((-210), (-210), (-210));
        ColorImage arg0 = new ColorImage(1277, 1277);
        // Undeclared exception!
        shift.apply(arg0);
    }
  }
  