@@ -0,0 +1,3293 @@
+package com.github.moko256.twicalico;%0A%0Aimport android.app.Application;%0Aimport android.test.ApplicationTestCase;%0Aimport android.test.RenamingDelegatingContext;%0A%0Aimport twitter4j.auth.AccessToken;%0A%0A/**%0A * Created by moko256 on 2017/03/04.%0A *%0A * @author moko256%0A */%0A%0Apublic class TokenSQLiteOpenHelperTest extends ApplicationTestCase%3CApplication%3E %7B%0A%0A    private static final long TEST_USER_1_USER_ID = 1L;%0A%0A    private static final String TEST_USER_1_USER_SCREEN_NAME_1 = %22testUser1%22;%0A    private static final String TEST_USER_1_USER_TOKEN_1 = %22token1%22;%0A    private static final String TEST_USER_1_USER_TOKEN_SECRET_1 = %22token_secret1%22;%0A%0A    private static final String TEST_USER_1_USER_SCREEN_NAME_2 = %22testUser1_renamed%22;%0A    private static final String TEST_USER_1_USER_TOKEN_2 = %22token2%22;%0A    private static final String TEST_USER_1_USER_TOKEN_SECRET_2 = %22token_secret2%22;%0A%0A    public TokenSQLiteOpenHelperTest() %7B%0A        super(Application.class);%0A    %7D%0A%0A    @Override%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A%0A        TokenSQLiteOpenHelper helper = new TokenSQLiteOpenHelper(new RenamingDelegatingContext(getContext(), %22test_%22));%0A%0A        final long addAccessTokenResult = helper.addAccessToken(%0A                generateAccessToken(%0A                TEST_USER_1_USER_ID,%0A                TEST_USER_1_USER_SCREEN_NAME_1,%0A                TEST_USER_1_USER_TOKEN_1,%0A                TEST_USER_1_USER_TOKEN_SECRET_1%0A                )%0A        );%0A%0A        assertEquals(addAccessTokenResult, 1);%0A%0A        AccessToken addedAccessTokenResult = helper.getAccessToken(0);%0A%0A        assertEquals(addedAccessTokenResult.getUserId(), TEST_USER_1_USER_ID);%0A        assertEquals(addedAccessTokenResult.getScreenName(), TEST_USER_1_USER_SCREEN_NAME_1);%0A        assertEquals(addedAccessTokenResult.getToken(), TEST_USER_1_USER_TOKEN_1);%0A        assertEquals(addedAccessTokenResult.getTokenSecret(), TEST_USER_1_USER_TOKEN_SECRET_1);%0A%0A%0A%0A        final long updateAccessTokenResult = helper.addAccessToken(%0A                generateAccessToken(%0A                        TEST_USER_1_USER_ID,%0A                        TEST_USER_1_USER_SCREEN_NAME_2,%0A                        TEST_USER_1_USER_TOKEN_2,%0A                        TEST_USER_1_USER_TOKEN_SECRET_2%0A                )%0A        );%0A%0A        assertEquals(updateAccessTokenResult, 1);%0A%0A        AccessToken updatedAccessTokenResult = helper.getAccessToken(0);%0A%0A        assertEquals(updatedAccessTokenResult.getScreenName(), TEST_USER_1_USER_SCREEN_NAME_2);%0A        assertEquals(updatedAccessTokenResult.getToken(), TEST_USER_1_USER_TOKEN_2);%0A        assertEquals(updatedAccessTokenResult.getTokenSecret(), TEST_USER_1_USER_TOKEN_SECRET_2);%0A%0A%0A%0A        final long deleteAccessTokenResult = helper.deleteAccessToken(TEST_USER_1_USER_ID);%0A        assertEquals(deleteAccessTokenResult, 0);%0A%0A        helper.close();%0A    %7D%0A%0A    private AccessToken generateAccessToken(final long userId, final String screenName, final String token, final String tokenSecret)%7B%0A        return new AccessToken(token, tokenSecret)%7B%0A            @Override%0A            public String getScreenName() %7B%0A                return screenName;%0A            %7D%0A%0A            @Override%0A            public long getUserId() %7B%0A                return userId;%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

add TokenSQLiteOpenHelperTest