blob: 3f846e664019a973cd0723cd4f636c07b4e3afe4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package com.mapbox.mapboxsdk;
import android.text.format.DateUtils;
import org.junit.Assert;
import org.junit.Test;
public class AccountsManagerTest {
@Test
public void testIsExpired() {
long now = AccountsManager.getNow();
long defaultValue = 0L;
long tooOld = now - DateUtils.HOUR_IN_MILLIS - 1;
long futureValue = now + 1;
long immediatePast = now - 1;
Assert.assertTrue(AccountsManager.isExpired(now, defaultValue));
Assert.assertTrue(AccountsManager.isExpired(now, tooOld));
Assert.assertFalse(AccountsManager.isExpired(now, futureValue));
Assert.assertFalse(AccountsManager.isExpired(now, immediatePast));
}
}
|