use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindDimenTest method asInt.
@Test
public void asInt() {
IntTarget target = new IntTarget();
int expected = context.getResources().getDimensionPixelSize(R.dimen.twelve_point_two_dp);
Unbinder unbinder = new BindDimenTest$IntTarget_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindFloatTest method asFloat.
@Test
public void asFloat() {
Target target = new Target();
TypedValue value = new TypedValue();
context.getResources().getValue(R.dimen.twelve_point_two, value, true);
float expected = value.getFloat();
Unbinder unbinder = new BindFloatTest$Target_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
use of butterknife.Unbinder in project butterknife by JakeWharton.
the class BindStringTest method simpleInt.
@Test
public void simpleInt() {
Target target = new Target();
String expected = context.getString(R.string.hey);
Unbinder unbinder = new BindStringTest$Target_ViewBinding(target, context);
assertThat(target.actual).isEqualTo(expected);
unbinder.unbind();
assertThat(target.actual).isEqualTo(expected);
}
Aggregations