use of butterknife.Unbinder in project butterknife by JakeWharton.
the class OnItemLongClickTest method multipleIds.
@UiThreadTest
@Test
public void multipleIds() {
View tree = ViewTree.create(TestSpinner.class, 1, 2);
TestSpinner spinner1 = tree.findViewById(1);
TestSpinner spinner2 = tree.findViewById(2);
MultipleIds target = new MultipleIds();
Unbinder unbinder = ButterKnife.bind(target, tree);
assertEquals(-1, target.clickedPosition);
spinner1.performItemLongClick(0);
assertEquals(0, target.clickedPosition);
spinner2.performItemLongClick(1);
assertEquals(1, target.clickedPosition);
unbinder.unbind();
spinner1.performItemLongClick(2);
assertEquals(1, target.clickedPosition);
spinner2.performItemLongClick(2);
assertEquals(1, target.clickedPosition);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class OnItemLongClickTest method simple.
@UiThreadTest
@Test
public void simple() {
View tree = ViewTree.create(TestSpinner.class, 1);
TestSpinner spinner = tree.findViewById(1);
Simple target = new Simple();
Unbinder unbinder = ButterKnife.bind(target, tree);
assertEquals(-1, target.clickedPosition);
assertTrue(spinner.performItemLongClick(0));
assertEquals(0, target.clickedPosition);
target.returnValue = false;
assertFalse(spinner.performItemLongClick(1));
assertEquals(1, target.clickedPosition);
unbinder.unbind();
spinner.performItemLongClick(2);
assertEquals(1, target.clickedPosition);
}
Aggregations