@Test public void when_adminPassHasNullValue_should_isAdminPasswordSetReturnFalse() { AdminSharedPreferences adminSharedPreferences = mock(AdminSharedPreferences.class); when(adminSharedPreferences.get(KEY_ADMIN_PW)).thenReturn(null); AdminPasswordProvider adminPasswordProvider = new AdminPasswordProvider(adminSharedPreferences); assertThat(adminPasswordProvider.isAdminPasswordSet(), is(false)); }
public boolean isAdminPasswordSet() { String adminPassword = getAdminPassword(); return adminPassword != null && !adminPassword.isEmpty(); }
AdminPasswordProvider { public boolean isAdminPasswordSet() { String adminPassword = getAdminPassword(); return adminPassword != null && !adminPassword.isEmpty(); } }
AdminPasswordProvider { public boolean isAdminPasswordSet() { String adminPassword = getAdminPassword(); return adminPassword != null && !adminPassword.isEmpty(); } AdminPasswordProvider(AdminSharedPreferences adminSharedPreferences); }
AdminPasswordProvider { public boolean isAdminPasswordSet() { String adminPassword = getAdminPassword(); return adminPassword != null && !adminPassword.isEmpty(); } AdminPasswordProvider(AdminSharedPreferences adminSharedPreferences); boolean isAdminPasswordSet(); String getAdminPassword(); }
AdminPasswordProvider { public boolean isAdminPasswordSet() { String adminPassword = getAdminPassword(); return adminPassword != null && !adminPassword.isEmpty(); } AdminPasswordProvider(AdminSharedPreferences adminSharedPreferences); boolean isAdminPasswordSet(); String getAdminPassword();  }