use of com.fsck.k9.mailstore.migrations.MigrationTo51.MimeStructureState in project k-9 by k9mail.
the class MigrationMimeStructureStateTest method init_apply_shouldYieldStartValues.
@Test
public void init_apply_shouldYieldStartValues() throws Exception {
MimeStructureState state = MimeStructureState.getNewRootState();
ContentValues cv = new ContentValues();
state.applyValues(cv);
Assert.assertEquals(-1L, cv.get("parent"));
Assert.assertEquals(0, cv.get("seq"));
Assert.assertEquals(2, cv.size());
}
use of com.fsck.k9.mailstore.migrations.MigrationTo51.MimeStructureState in project k-9 by k9mail.
the class MigrationMimeStructureStateTest method init_popParent_shouldCrash.
@Test(expected = IllegalStateException.class)
public void init_popParent_shouldCrash() throws Exception {
MimeStructureState state = MimeStructureState.getNewRootState();
state.popParent();
}
use of com.fsck.k9.mailstore.migrations.MigrationTo51.MimeStructureState in project k-9 by k9mail.
the class MigrationMimeStructureStateTest method init_nextchild_shouldCrash.
@Test(expected = IllegalStateException.class)
public void init_nextchild_shouldCrash() throws Exception {
MimeStructureState state = MimeStructureState.getNewRootState();
state.nextChild(1);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo51.MimeStructureState in project k-9 by k9mail.
the class MigrationMimeStructureStateTest method init_nextmulti_shouldCrash.
@Test(expected = IllegalStateException.class)
public void init_nextmulti_shouldCrash() throws Exception {
MimeStructureState state = MimeStructureState.getNewRootState();
state.nextMultipartChild(1);
}
use of com.fsck.k9.mailstore.migrations.MigrationTo51.MimeStructureState in project k-9 by k9mail.
the class MigrationMimeStructureStateTest method init_apply_nextmulti_apply_nextmulti_apply_shouldYieldSecondMultipartChildValues.
@Test
public void init_apply_nextmulti_apply_nextmulti_apply_shouldYieldSecondMultipartChildValues() throws Exception {
MimeStructureState state = MimeStructureState.getNewRootState();
ContentValues cv = new ContentValues();
state.applyValues(cv);
state = state.nextMultipartChild(123);
cv.clear();
state.applyValues(cv);
state = state.nextMultipartChild(456);
cv.clear();
state.applyValues(cv);
Assert.assertEquals(123L, cv.get("root"));
Assert.assertEquals(456L, cv.get("parent"));
Assert.assertEquals(2, cv.get("seq"));
Assert.assertEquals(3, cv.size());
}
Aggregations