@Test public void doBind_When_NoViewBinderPut_Should_CreateViewBinder_PutViewBinderWithTargetClass_BindWithViewBinder() { core.doBind(target, viewFinder); verify(viewFinder).putBinder(same(target.getClass()), same(targetViewBinderFromFactory)); verify(targetViewBinderFromFactory).bind(same(viewHolderFromFactory), same(viewFinder), same(target)); }
public void doBind(Object target, ViewFinder viewFinder) { Object viewHolder = getOrCreateViewHolder(target, viewFinder); TargetViewBinder targetViewBinder = getOrCreateBinder(target, viewFinder); targetViewBinder.bind(viewHolder, viewFinder, target); if (loggingEnabled && logger != null) { String description = targetViewBinder.describeTarget(target); logger.v(description); } }
WitchCore { public void doBind(Object target, ViewFinder viewFinder) { Object viewHolder = getOrCreateViewHolder(target, viewFinder); TargetViewBinder targetViewBinder = getOrCreateBinder(target, viewFinder); targetViewBinder.bind(viewHolder, viewFinder, target); if (loggingEnabled && logger != null) { String description = targetViewBinder.describeTarget(target); logger.v(description); } } }
WitchCore { public void doBind(Object target, ViewFinder viewFinder) { Object viewHolder = getOrCreateViewHolder(target, viewFinder); TargetViewBinder targetViewBinder = getOrCreateBinder(target, viewFinder); targetViewBinder.bind(viewHolder, viewFinder, target); if (loggingEnabled && logger != null) { String description = targetViewBinder.describeTarget(target); logger.v(description); } } WitchCore(ViewHolderFactory viewHolderFactory, BinderFactory binderFactory, Logger logger); }
WitchCore { public void doBind(Object target, ViewFinder viewFinder) { Object viewHolder = getOrCreateViewHolder(target, viewFinder); TargetViewBinder targetViewBinder = getOrCreateBinder(target, viewFinder); targetViewBinder.bind(viewHolder, viewFinder, target); if (loggingEnabled && logger != null) { String description = targetViewBinder.describeTarget(target); logger.v(description); } } WitchCore(ViewHolderFactory viewHolderFactory, BinderFactory binderFactory, Logger logger); boolean isLoggingEnabled(); void setLoggingEnabled(boolean loggingEnabled); void doBind(Object target, ViewFinder viewFinder); }
WitchCore { public void doBind(Object target, ViewFinder viewFinder) { Object viewHolder = getOrCreateViewHolder(target, viewFinder); TargetViewBinder targetViewBinder = getOrCreateBinder(target, viewFinder); targetViewBinder.bind(viewHolder, viewFinder, target); if (loggingEnabled && logger != null) { String description = targetViewBinder.describeTarget(target); logger.v(description); } } WitchCore(ViewHolderFactory viewHolderFactory, BinderFactory binderFactory, Logger logger); boolean isLoggingEnabled(); void setLoggingEnabled(boolean loggingEnabled); void doBind(Object target, ViewFinder viewFinder);  }