@Test public void when_adminPassIsSetProperly_should_isAdminPasswordSetReturnTrue() { AdminSharedPreferences adminSharedPreferences = mock(AdminSharedPreferences.class); when(adminSharedPreferences.get(KEY_ADMIN_PW)).thenReturn("123"); AdminPasswordProvider adminPasswordProvider = new AdminPasswordProvider(adminSharedPreferences); assertThat(adminPasswordProvider.isAdminPasswordSet(), is(true)); }
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();  }