Search in sources :

Example 1 with VerticalChangeHandler

use of com.bluelinelabs.conductor.changehandler.VerticalChangeHandler in project Conductor by bluelinelabs.

the class ControllerTransactionTests method testRouterSaveRestore.

@Test
public void testRouterSaveRestore() {
    RouterTransaction transaction = RouterTransaction.with(new TestController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new VerticalChangeHandler()).tag("Test Tag");
    Bundle bundle = transaction.saveInstanceState();
    RouterTransaction restoredTransaction = new RouterTransaction(bundle);
    assertEquals(transaction.controller.getClass(), restoredTransaction.controller.getClass());
    assertEquals(transaction.pushChangeHandler().getClass(), restoredTransaction.pushChangeHandler().getClass());
    assertEquals(transaction.popChangeHandler().getClass(), restoredTransaction.popChangeHandler().getClass());
    assertEquals(transaction.tag(), restoredTransaction.tag());
}
Also used : Bundle(android.os.Bundle) TestController(com.bluelinelabs.conductor.util.TestController) VerticalChangeHandler(com.bluelinelabs.conductor.changehandler.VerticalChangeHandler) HorizontalChangeHandler(com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler) Test(org.junit.Test)

Aggregations

Bundle (android.os.Bundle)1 HorizontalChangeHandler (com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler)1 VerticalChangeHandler (com.bluelinelabs.conductor.changehandler.VerticalChangeHandler)1 TestController (com.bluelinelabs.conductor.util.TestController)1 Test (org.junit.Test)1