use of butterknife.Unbinder in project butterknife by JakeWharton.
the class OnTouchTest method optionalIdAbsent.
@UiThreadTest
@Test
public void optionalIdAbsent() {
View tree = ViewTree.create(2);
View view2 = tree.findViewById(2);
OptionalId target = new OptionalId();
Unbinder unbinder = ButterKnife.bind(target, tree);
assertEquals(0, target.touches);
performTouch(view2);
assertEquals(0, target.touches);
unbinder.unbind();
performTouch(view2);
assertEquals(0, target.touches);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class OnTouchTest method returnVoid.
@UiThreadTest
@Test
public void returnVoid() {
View tree = ViewTree.create(1);
View view1 = tree.findViewById(1);
ReturnVoid target = new ReturnVoid();
Unbinder unbinder = ButterKnife.bind(target, tree);
assertEquals(0, target.touches);
assertTrue(performTouch(view1));
assertEquals(1, target.touches);
unbinder.unbind();
performTouch(view1);
assertEquals(1, target.touches);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class OnTouchTest method optionalIdPresent.
@UiThreadTest
@Test
public void optionalIdPresent() {
View tree = ViewTree.create(1);
View view1 = tree.findViewById(1);
OptionalId target = new OptionalId();
Unbinder unbinder = ButterKnife.bind(target, tree);
assertEquals(0, target.touches);
performTouch(view1);
assertEquals(1, target.touches);
unbinder.unbind();
performTouch(view1);
assertEquals(1, target.touches);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class SimpleActivityTest method verifyContentViewBinding.
@Test
public void verifyContentViewBinding() {
SimpleActivity activity = activityRule.getActivity();
Unbinder unbinder = ButterKnife.bind(activity);
verifySimpleActivityBound(activity);
unbinder.unbind();
verifySimpleActivityUnbound(activity);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class UnbinderTest method verifyContentViewBinding.
@Test
public void verifyContentViewBinding() {
FrameLayout frameLayout = new FrameLayout(context);
Button button1 = new Button(context);
button1.setId(android.R.id.button1);
frameLayout.addView(button1);
Button button2 = new Button(context);
button2.setId(android.R.id.button2);
frameLayout.addView(button2);
Button button3 = new Button(context);
button3.setId(android.R.id.button3);
frameLayout.addView(button3);
View content = new View(context);
content.setId(android.R.id.content);
frameLayout.addView(content);
H h = new H(frameLayout);
Unbinder unbinder = ButterKnife.bind(h, frameLayout);
verifyHBound(h);
unbinder.unbind();
verifyHUnbound(h);
}
Aggregations