/*
 * This file was automatically generated by EvoSuite
 * Wed Sep 19 19:26:37 GMT 2018
 */

package uk.ac.sanger.artemis;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.Comparator;
import java.util.function.Function;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.FeatureSegment;
import uk.ac.sanger.artemis.PositionComparator;
import uk.ac.sanger.artemis.sequence.Marker;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true) 
public class PositionComparator_ESTest extends PositionComparator_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      PositionComparator positionComparator0 = new PositionComparator();
      Function<Object, Integer> function0 = (Function<Object, Integer>) mock(Function.class, new ViolatedAssumptionAnswer());
      Comparator.comparing((Function<? super FeatureSegment, ? extends Integer>) function0);
      Marker marker0 = mock(Marker.class, new ViolatedAssumptionAnswer());
      doReturn(0).when(marker0).getPosition();
      FeatureSegment featureSegment0 = mock(FeatureSegment.class, new ViolatedAssumptionAnswer());
      doReturn(marker0, (Marker) null).when(featureSegment0).getStart();
      // Undeclared exception!
      try { 
        positionComparator0.compare(featureSegment0, featureSegment0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.PositionComparator", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      PositionComparator positionComparator0 = new PositionComparator();
      Marker marker0 = mock(Marker.class, new ViolatedAssumptionAnswer());
      doReturn(1).when(marker0).getPosition();
      Marker marker1 = mock(Marker.class, new ViolatedAssumptionAnswer());
      doReturn(6).when(marker1).getPosition();
      FeatureSegment featureSegment0 = mock(FeatureSegment.class, new ViolatedAssumptionAnswer());
      doReturn(marker0, marker1).when(featureSegment0).getStart();
      int int0 = positionComparator0.compare(featureSegment0, featureSegment0);
      assertEquals((-1), int0);
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      PositionComparator positionComparator0 = new PositionComparator();
      Marker marker0 = mock(Marker.class, new ViolatedAssumptionAnswer());
      doReturn(3176).when(marker0).getPosition();
      FeatureSegment featureSegment0 = mock(FeatureSegment.class, new ViolatedAssumptionAnswer());
      doReturn(marker0).when(featureSegment0).getStart();
      Marker marker1 = mock(Marker.class, new ViolatedAssumptionAnswer());
      doReturn(0).when(marker1).getPosition();
      FeatureSegment featureSegment1 = mock(FeatureSegment.class, new ViolatedAssumptionAnswer());
      doReturn(marker1).when(featureSegment1).getStart();
      int int0 = positionComparator0.compare(featureSegment0, featureSegment1);
      assertEquals(1, int0);
  }
}
