content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 04:31:55 GMT 2024
   */
  
  package net.sf.sugar.fspath;
  
  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 java.io.File;
  import java.net.URI;
  import java.util.Date;
  import net.sf.sugar.fspath.FSPathResult;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.System;
  import org.evosuite.runtime.mock.java.io.MockFile;
  import org.evosuite.runtime.mock.java.net.MockURI;
  import org.evosuite.runtime.mock.java.util.MockDate;
  import org.junit.runner.RunWith;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class FSPathResult_ESTest extends FSPathResult_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetURIReturningNull() throws Throwable  {
        // Test that getURI() returns null when the FSPathResult contains a negative value
        Double inputValue = new Double((-1602.784826347408));
        FSPathResult fsPathResult = new FSPathResult(inputValue);
        URI outputUri = fsPathResult.getURI();
        assertNull(outputUri);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetURIReturningURIWhereIsOpaqueIsTrue() throws Throwable  {
        // This test verifies that the URI returned by the FSPathResult has a null raw query.
        // Given a FSPathResult object with a specific URI
        URI arg0 = MockURI.URI("L", "L", "net.sf.sugar.fspath.FSPathResult");
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // When the getURI method is called on the FSPathResult object
        URI uRI = fSPathResult.getURI();
        
        // Then the raw query of the returned URI should be null
        assertNull(uRI.getRawQuery());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetURIReturningURIWhereGetPortIsPositive() throws Throwable  {
        // Create a mock URI object with some arbitrary values
        URI arg0 = MockURI.URI("net.sf.sugar.fspath.FSPathResult", "", "net.sf.sugar.fspath.FSPathResult", 1146, "", "Zwp^dzVO6P", "Jd(orXh]1hV");
        // Create a new FSPathResult object with the mock URI
        FSPathResult fSPathResult = new FSPathResult(arg0);
        // Get the URI from the FSPathResult object
        URI uRI = fSPathResult.getURI();
        // Assert that the raw user info of the URI is empty
        assertEquals("", uRI.getRawUserInfo());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetURIReturningURIWhereIsAbsoluteIsFalse() throws Throwable  {
        // Create a mock URI object
        URI arg0 = MockURI.URI("");
        
        // Create an instance of FSPathResult with the mock URI object
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // Get the URI from the FSPathResult instance
        URI uRI = fSPathResult.getURI();
        
        // Check that the host of the URI is null
        assertNull(uRI.getHost());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetStringReturningNonEmptyString() throws Throwable  {
        // Given: A FSPathResult object with a valid path
        FSPathResult fSPathResult = new FSPathResult("SZi])_");
        
        // When: The getString() method is called on the FSPathResult object
        String string = fSPathResult.getString();
        
        // Then: The returned string should be equal to the original path passed in
        assertEquals("SZi])_", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetStringReturningEmptyString() throws Throwable  {
        // Given
        FSPathResult fsPathResult = new FSPathResult("");
        
        // When
        String resultString = fsPathResult.getString();
        
        // Then
        assertEquals("", resultString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFileReturningNull() throws Throwable  {
        // Arrange
        URI arg0 = MockURI.URI("net.sf.sugar.fspath.FSPathResult", "net.sf.sugar.fspath.FSPathResult", "net.sf.sugar.fspath.FSPathResult", 0, (String) null, (String) null, "");
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // Act
        File file = fSPathResult.getFile();
        
        // Assert
        assertNull(file);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFileReturningFileWhereLastModifiedIsNegative() throws Throwable  {
        // Given: a new FSPathResult object with an empty file
        File tempFile = MockFile.createTempFile("FSPathResult : empty", "FSPathResult : empty");
        FSPathResult fSPathResult = new FSPathResult(tempFile);
        
        // When: the file is accessed
        File file = fSPathResult.getFile();
        
        // Then: the file length should be 0
        assertEquals(0L, file.length());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFileReturningFileWhereLastModifiedIsZero() throws Throwable  {
        // Given: A MockFile object with a name that is not a valid path
        MockFile arg0 = new MockFile("", ".)dg;OZM'a");
        
        // When: The FSPathResult is created with the MockFile object
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // Then: The resulting File object should not be able to read
        File file = fSPathResult.getFile();
        assertFalse(file.canRead());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateReturningNonNull() throws Throwable  {
        // Given a MockDate instance with value 0L
        MockDate arg0 = new MockDate(0L);
        
        // When the getDate method is called on a FSPathResult instance
        FSPathResult fSPathResult = new FSPathResult(arg0);
        Date date = fSPathResult.getDate();
        
        // Then the returned value should be the same as the argument passed to the constructor
        assertSame(arg0, date);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToStringReturningEmptyString() throws Throwable  {
        // Test that the FSPathResult class returns the correct path when converted to a string.
        URI arg0 = MockURI.URI("");
        FSPathResult fSPathResult = new FSPathResult(arg0);
        String string = fSPathResult.toString();
        assertEquals("", string); // Assert that the empty path is returned as an empty string.
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testToStringReturningNonEmptyString() throws Throwable  {
        // rollbacked to evosuite
        FSPathResult fSPathResult = new FSPathResult((Boolean) null);
        String string = fSPathResult.toString();
        assertEquals("FSPathResult : empty", string);
        assertNotNull(string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFSPathResultTakingBoolean() throws Throwable  {
        // Given a FSPathResult object with a boolean argument set to true
        Boolean arg = Boolean.TRUE;
        FSPathResult fSPathResult = new FSPathResult(arg);
        
        // When the toString method is called on the FSPathResult object
        String stringRepresentation = fSPathResult.toString();
        
        // Then the result should be a string with the value "true"
        assertEquals("true", stringRepresentation);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFSPathResultTakingDate() throws Throwable  {
        // rollbacked to evosuite
        MockDate arg0 = new MockDate();
        FSPathResult fSPathResult = new FSPathResult(arg0);
        String string = fSPathResult.toString();
        assertNotNull(string);
        assertEquals("Fri Feb 14 20:21:21 GMT 2014", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFSPathResultTakingString() throws Throwable  {
        // Given an FSPathResult object with a path that contains special characters
        FSPathResult fSPathResult = new FSPathResult("(en);bge1T");
        
        // When the toString method is called on the object
        String string = fSPathResult.toString();
        
        // Then the method should return a string that represents the path with special characters escaped
        assertEquals("(en);bge1T", string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFSPathResultTakingFile() throws Throwable  {
        // Given: We have a MockFile object with a specific name.
        MockFile mockFile = new MockFile("hOt2+5BmR!88");
        
        // When: We create a FSPathResult object using the MockFile object.
        FSPathResult fsPathResult = new FSPathResult(mockFile);
        
        // Then: The FSPathResult object should have a toString() method that returns a string with the expected format.
        String actualString = fsPathResult.toString();
        String expectedString = "/home/ubuntu/getting-new-results-dynamosa/non-trivial-java-classes-to-study-search-based-software-testing-approaches/subjects/60_sugar/hOt2+5BmR!88";
        assertEquals(expectedString, actualString);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesFSPathResultTakingDouble() throws Throwable  {
        // Given a FSPathResult object with a negative double value
        Double arg0 = new Double((-1602.784826347408));
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // When the toString method is called on the object
        String string = fSPathResult.toString();
        
        // Then the result should be a string representation of the negative double value
        assertEquals("-1602.784826347408", string);
        
        // And the result should not be null
        assertNotNull(string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetFileReturningFileWhereLastModifiedIsPositive() throws Throwable  {
        // Set up the mock object for the file to be tested
        MockFile arg0 = new MockFile("");
        
        // Create a new instance of FSPathResult using the mock file
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // Get the file object from the FSPathResult
        File file = fSPathResult.getFile();
        
        // Assert that the file exists
        assertTrue(file.exists());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetStringReturningNull() throws Throwable  {
        // rollbacked to evosuite
        Boolean arg0 = Boolean.TRUE;
        FSPathResult fSPathResult = new FSPathResult(arg0);
        String string = fSPathResult.getString();
        assertNull(string);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetDateReturningNull() throws Throwable  {
        // Test that getDate() returns null when called on an FSPathResult with a MockFile that doesn't have a date set
        MockFile arg0 = new MockFile("hOt2+5BmR!88");
        FSPathResult fSPathResult = new FSPathResult(arg0);
        Date date = fSPathResult.getDate();
        // Verify that the date is null as expected
        assertNull(date);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetURIReturningURIWhereGetPortIsZero() throws Throwable  {
        // Given a FSPathResult object with a URI argument
        URI arg0 = MockURI.URI("net.sf.sugar.fspath.FSPathResult", "net.sf.sugar.fspath.FSPathResult", "net.sf.sugar.fspath.FSPathResult", 0, (String) null, (String) null, "");
        FSPathResult fSPathResult = new FSPathResult(arg0);
        
        // When the getURI method is called on the object
        URI uRI = fSPathResult.getURI();
        
        // Then the same URI should be returned as was passed in as an argument
        assertSame(arg0, uRI);
    }
  }
  