@Test
public void deviceNameRendering1() throws Exception {

  String serial = "123";
  IDevice d = createDevice(false, null, manufacturer, model, buildVersion, apiLevel, serial, IDevice.DeviceState.ONLINE);
  DeviceNameProperties deviceNameProperties = new DeviceNameProperties(model, manufacturer, buildVersion, apiLevel);
  SimpleColoredText target = new SimpleColoredText();
  DeviceRenderer.renderDeviceName(d, deviceNameProperties, target, false);
  String name = target.toString();
  assertEquals(String.format("%s %s Android %s, API %s",
                             StringUtil.capitalizeWords(manufacturer, false),
                             StringUtil.capitalizeWords(model, false),
                             buildVersion,
                             apiLevel),
               name);
  // status should be shown only if !online
  assertFalse(StringUtil.containsIgnoreCase(name, IDevice.DeviceState.ONLINE.toString()));
  // serial should be shown only if !online
  assertFalse(StringUtil.containsIgnoreCase(name, serial));
}