mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Store nickname and password across screen rotations.
This commit is contained in:
@@ -73,7 +73,7 @@ public class PasswordFragmentTest {
|
||||
|
||||
// assert controller has been called properly
|
||||
verify(setupController, times(1)).setPassword(safePass);
|
||||
verify(setupController, times(1)).showDozeOrCreateAccount();
|
||||
verify(setupController, times(1)).showDozeFragmentOrCreateAccount();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -15,22 +15,8 @@ import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.NONE;
|
||||
import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.QUITE_STRONG;
|
||||
import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.QUITE_WEAK;
|
||||
import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.STRONG;
|
||||
import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.WEAK;
|
||||
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||
import static org.briarproject.bramble.util.StringUtils.getRandomString;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.timeout;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.robolectric.Shadows.shadowOf;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(sdk = 21, application = TestBriarApplication.class,
|
||||
|
||||
@@ -47,10 +47,17 @@ public class SetupControllerImplTest extends BrambleMockTestCase {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
public void testCreateAccount() {
|
||||
context.checking(new Expectations() {{
|
||||
// Setting the author name shows the password fragment
|
||||
oneOf(setupActivity).showPasswordFragment();
|
||||
// Set the author name and password
|
||||
oneOf(setupActivity).setAuthorName(authorName);
|
||||
oneOf(setupActivity).setPassword(password);
|
||||
// Get the author name and password
|
||||
oneOf(setupActivity).getAuthorName();
|
||||
will(returnValue(authorName));
|
||||
oneOf(setupActivity).getPassword();
|
||||
will(returnValue(password));
|
||||
// Generate a database key
|
||||
oneOf(crypto).generateSecretKey();
|
||||
will(returnValue(key));
|
||||
|
||||
Reference in New Issue
Block a user