/*
 * This file was automatically generated by EvoSuite
 * Thu Sep 20 13:27:56 GMT 2018
 */

package uk.ac.sanger.artemis.io;

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.io.Writer;
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.io.Entry;
import uk.ac.sanger.artemis.io.GenbankMisc;
import uk.ac.sanger.artemis.io.LineGroup;
import uk.ac.sanger.artemis.util.LinePushBackReader;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
public class GenbankMisc_ESTest extends GenbankMisc_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn(" ", " ", " ", (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      Writer writer0 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer0);
      Writer writer1 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.toString();
      LinePushBackReader linePushBackReader1 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(linePushBackReader1).readLine();
      Entry entry0 = mock(Entry.class, new ViolatedAssumptionAnswer());
      LineGroup.readNextLineGroup(linePushBackReader1, entry0);
      genbankMisc0.writeToStream(writer1);
      Writer writer2 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer2);
      Writer writer3 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer3);
      Writer writer4 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer4);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("FEATURES ").when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      Writer writer0 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer0);
      Writer writer1 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer1);
      Writer writer2 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer2);
      Writer writer3 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer3);
      Writer writer4 = null;
      // Undeclared exception!
      try { 
        genbankMisc0.writeToStream((Writer) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.io.GenbankMisc", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn(" ", (String) null, (String) null, (String) null, (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn(" 7_E2xp6>Ct!&.", (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      String string0 = "warning: could not auto save to: ";
      LineGroup.getLineType(string0);
      Writer writer0 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.toString();
      Writer writer1 = mock(Writer.class, new ViolatedAssumptionAnswer());
      LineGroup.writeEndOfEMBLEntry(writer1);
      Writer writer2 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer2);
      genbankMisc0.writeToStream(writer0);
      Writer writer3 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer3);
      Writer writer4 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer4);
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("y", (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      assertNotNull(genbankMisc0);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer0 = mock(Writer.class, new ViolatedAssumptionAnswer());
      LineGroup.writeEndOfEMBLEntry(writer0);
      Writer writer1 = mock(Writer.class, new ViolatedAssumptionAnswer());
      LineGroup.writeStartOfGFFEntry(writer1);
      Writer writer2 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer2);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer3 = mock(Writer.class, new ViolatedAssumptionAnswer());
      LineGroup.writeStartOfGFFEntry(writer3);
      Writer writer4 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer4);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer5 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer5);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer6 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer6);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer7 = mock(Writer.class, new ViolatedAssumptionAnswer());
      LineGroup.writeStartOfGFFEntry(writer7);
      Writer writer8 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer8);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer9 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer9);
      assertEquals("y", genbankMisc0.getLine());
      
      Writer writer10 = null;
      // Undeclared exception!
      try { 
        genbankMisc0.writeToStream((Writer) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.io.GenbankMisc", e);
      }
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("?#", (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      assertNotNull(genbankMisc0);
      assertEquals("?#", genbankMisc0.getLine());
      
      Writer writer0 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer0);
      assertEquals("?#", genbankMisc0.getLine());
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("k.ac.sanger.aremis.io.GFFMic", (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      assertNotNull(genbankMisc0);
      assertEquals("k.ac.sanger.aremis.io.GFFMic", genbankMisc0.getLine());
      
      // Undeclared exception!
      try { 
        genbankMisc0.writeToStream((Writer) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.io.GenbankMisc", e);
      }
  }

  @Test(timeout = 4000)
  public void test7()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("R!uiI+AZnPK/7]+Q", (String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      assertNotNull(genbankMisc0);
      assertEquals("R!uiI+AZnPK/7]+Q", genbankMisc0.getLine());
  }

  @Test(timeout = 4000)
  public void test8()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = null;
      try {
        genbankMisc0 = new GenbankMisc(linePushBackReader0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
      }
  }

  @Test(timeout = 4000)
  public void test9()  throws Throwable  {
      LinePushBackReader linePushBackReader0 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("0i*Fw(kc0", " _/!;dHq*", "0u").when(linePushBackReader0).readLine();
      GenbankMisc genbankMisc0 = new GenbankMisc(linePushBackReader0);
      Writer writer0 = mock(Writer.class, new ViolatedAssumptionAnswer());
      genbankMisc0.writeToStream(writer0);
      LinePushBackReader linePushBackReader1 = mock(LinePushBackReader.class, new ViolatedAssumptionAnswer());
      doReturn("FEATURES ", (String) null).when(linePushBackReader1).readLine();
      Entry entry0 = mock(Entry.class, new ViolatedAssumptionAnswer());
      // Undeclared exception!
      try { 
        LineGroup.readNextLineGroup(linePushBackReader1, entry0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
      }
  }
}
