EditCommand edit = new EditCommand("", Action.REPLACE, "----",
new SequenceI[]
{ seqs[1] }, 0, 4, al);
+
// trimmed start
assertEquals("----klmnopq", seqs[1].getSequenceAsString());
// and ds is preserved
assertEquals("fghjklmnopq", dsseq.getSequenceAsString());
// and that alignment sequence start has been adjusted
assertEquals(5, seqs[1].getStart());
+ assertEquals(11, seqs[1].getEnd());
+
AlignmentI[] views = new AlignmentI[] { new Alignment(seqs) };
// and undo
edit.undoCommand(views);
assertEquals("fghjklmnopq", seqs[1].getSequenceAsString());
// and start/end numbering also restored
assertEquals(1, seqs[1].getStart());
+ assertEquals(11, seqs[1].getEnd());
+
+ // now redo
+ edit.undoCommand(views);
+
+ // and repeat asserts for the original edit
+
+ // trimmed start
+ assertEquals("----klmnopq", seqs[1].getSequenceAsString());
+ // and ds is preserved
+ assertTrue(dsseq == seqs[1].getDatasetSequence());
+ // and it is unchanged
+ assertEquals("fghjklmnopq", dsseq.getSequenceAsString());
+ // and that alignment sequence start has been adjusted
+ assertEquals(5, seqs[1].getStart());
+ assertEquals(11, seqs[1].getEnd());
}