/*
 * This file was automatically generated by EvoSuite
 * Wed Sep 19 22:10:25 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 org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.Action;
import uk.ac.sanger.artemis.ChangeEvent;
import uk.ac.sanger.artemis.ChangeEventVector;
import uk.ac.sanger.artemis.EntryChangeEvent;
import uk.ac.sanger.artemis.FeatureChangeEvent;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      Action action0 = new Action();
      action0.addEntryChangeEvent((EntryChangeEvent) null);
      ChangeEventVector changeEventVector0 = action0.getChangeEvents();
      assertEquals(1, changeEventVector0.size());
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      Action action0 = new Action();
      // Undeclared exception!
      try { 
        action0.addFeatureChangeEvent((FeatureChangeEvent) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.Action", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      Action action0 = new Action();
      FeatureChangeEvent featureChangeEvent0 = mock(FeatureChangeEvent.class, new ViolatedAssumptionAnswer());
      doReturn(true).when(featureChangeEvent0).featureHasChanged();
      action0.addFeatureChangeEvent(featureChangeEvent0);
      assertFalse(action0.isEmpty());
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      Action action0 = new Action();
      FeatureChangeEvent featureChangeEvent0 = mock(FeatureChangeEvent.class, new ViolatedAssumptionAnswer());
      doReturn(false).when(featureChangeEvent0).featureHasChanged();
      action0.addFeatureChangeEvent(featureChangeEvent0);
      assertTrue(action0.isEmpty());
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      EntryChangeEvent entryChangeEvent0 = mock(EntryChangeEvent.class, new ViolatedAssumptionAnswer());
      Action action0 = new Action();
      action0.addChangeEvent(entryChangeEvent0);
      assertFalse(action0.isEmpty());
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      Action action0 = new Action();
      ChangeEvent changeEvent0 = mock(ChangeEvent.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(changeEvent0).toString();
      // Undeclared exception!
      try { 
        action0.addChangeEvent(changeEvent0);
        fail("Expecting exception: Error");
      
      } catch(Error e) {
         //
         // internal error - unknown event type: Mock for ChangeEvent, hashCode: 2103874268
         //
         verifyException("uk.ac.sanger.artemis.Action", e);
      }
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      Action action0 = new Action();
      boolean boolean0 = action0.isEmpty();
      assertTrue(boolean0);
  }

  @Test(timeout = 4000)
  public void test7()  throws Throwable  {
      FeatureChangeEvent featureChangeEvent0 = mock(FeatureChangeEvent.class, new ViolatedAssumptionAnswer());
      doReturn(true).when(featureChangeEvent0).featureHasChanged();
      Action action0 = new Action();
      assertTrue(action0.isEmpty());
      
      action0.addChangeEvent(featureChangeEvent0);
      boolean boolean0 = action0.isEmpty();
      assertFalse(boolean0);
  }

  @Test(timeout = 4000)
  public void test8()  throws Throwable  {
      Action action0 = new Action();
      ChangeEventVector changeEventVector0 = action0.getChangeEvents();
      assertEquals(0, changeEventVector0.size());
  }
}
