aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/activity/ProgressTest.java
blob: e72c90ad71b26872bc93aeff2a80e39b41d22449 (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
25
26
27
28
29
30
package cgeo.geocaching.activity;

import cgeo.geocaching.cgeo;

import android.annotation.TargetApi;
import android.test.ActivityInstrumentationTestCase2;

@TargetApi(8)
public class ProgressTest extends ActivityInstrumentationTestCase2<cgeo> {
    public ProgressTest() {
        super(cgeo.class);
    }

    public void testProgressWrapper() {
        final Progress progress = new Progress();

        assertFalse(progress.isShowing()); // nothing shown initially

        progress.show(getActivity(), "Title", "Message", true, null);
        assertTrue(progress.isShowing());

        progress.setMessage("Test");
        assertTrue(progress.isShowing());

        for (int i = 0; i < 2; i++) { // fault tolerant when dismissing to often
            progress.dismiss();
            assertFalse(progress.isShowing());
        }
    }
}