package com.braintreepayments.api;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

import android.content.Context;

import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.security.GeneralSecurityException;

public class VenmoSharedPrefsWriterUnitTest {

    private Context context;
    private BraintreeSharedPreferences braintreeSharedPreferences;

    @Before
    public void beforeEach() throws GeneralSecurityException, IOException {
        context = mock(Context.class);
        braintreeSharedPreferences = mock(BraintreeSharedPreferences.class);
    }

    @Test
    public void persistVenmoVaultOption_persistsVaultOption() {
        VenmoSharedPrefsWriter sut = new VenmoSharedPrefsWriter(braintreeSharedPreferences);
        sut.persistVenmoVaultOption(context, true);
        verify(braintreeSharedPreferences).putBoolean(context, "com.braintreepayments.api.Venmo.VAULT_VENMO_KEY", true);
    }

    @Test
    public void getVenmoVaultOption_retrievesVaultOptionFromSharedPrefs() {
        VenmoSharedPrefsWriter sut = new VenmoSharedPrefsWriter(braintreeSharedPreferences);
        sut.getVenmoVaultOption(context);
        verify(braintreeSharedPreferences).getBoolean(context, "com.braintreepayments.api.Venmo.VAULT_VENMO_KEY");
    }
}
@@ -458,53 +458,8 @@
 ch()
- throws GeneralSecurityException, IOException
  %7B%0A 
@@ -651,16 +651,43 @@
 Option()
+ throws UnexpectedException
  %7B%0A     
@@ -1037,16 +1037,43 @@
 dPrefs()
+ throws UnexpectedException
  %7B%0A     

Update venmo unit test.