diff options
author | Adnan Begovic <adnan@cyngn.com> | 2016-06-07 17:06:27 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2016-06-13 11:28:07 -0700 |
commit | 2add3de26702b4568dd7af1c460a49b754d0ff74 (patch) | |
tree | afcb471d15cb980cbb86fb901e32d3f09590d9d9 /tests/src | |
parent | fda1fc68437629b20c019685d17847494ae9b594 (diff) | |
download | vendor_cmsdk-2add3de26702b4568dd7af1c460a49b754d0ff74.zip vendor_cmsdk-2add3de26702b4568dd7af1c460a49b754d0ff74.tar.gz vendor_cmsdk-2add3de26702b4568dd7af1c460a49b754d0ff74.tar.bz2 |
cmsdk: Provide tests for Profile.ProfileTrigger interfaces.
Change-Id: I2ece6365defdd126c2cce1bbdf1ccc7d671d3a70
TICKET: CYNGNOS-3021
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java b/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java index 38ba56e..364d36f 100644 --- a/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java +++ b/tests/src/org/cyanogenmod/tests/profiles/unit/ProfileTest.java @@ -32,6 +32,8 @@ import cyanogenmod.profiles.LockSettings; import cyanogenmod.profiles.RingModeSettings; import cyanogenmod.profiles.StreamSettings; +import java.util.UUID; + /** * Created by adnan on 7/14/15. */ @@ -227,4 +229,38 @@ public class ProfileTest extends AndroidTestCase { assertEquals(profile.getDozeMode(), fromParcel.getDozeMode()); assertEquals(profile.getStatusBarIndicator(), fromParcel.getStatusBarIndicator()); } + + private static final int EXPECTED_PROFILE_TRIGGER_TYPE = Profile.TriggerType.WIFI; + private static final String EXPECTED_PROFILE_TRIGGER_ID = "1337"; + private static final int EXPECTED_PROFILE_TRIGGER_STATE = Profile.TriggerState.ON_CONNECT; + private static final String EXPECTED_PROFILE_TRIGGER_NAME = "ON_CONNECT_WIFI_TRIGGER"; + private Profile.ProfileTrigger createSampleProfileTrigger() { + return new Profile.ProfileTrigger(EXPECTED_PROFILE_TRIGGER_TYPE, + EXPECTED_PROFILE_TRIGGER_ID, EXPECTED_PROFILE_TRIGGER_STATE, + EXPECTED_PROFILE_TRIGGER_NAME); + } + + @SmallTest + public void testProfileTriggerId() { + Profile.ProfileTrigger profileTrigger = createSampleProfileTrigger(); + assertEquals(EXPECTED_PROFILE_TRIGGER_ID, profileTrigger.getId()); + } + + @SmallTest + public void testProfileTriggerName() { + Profile.ProfileTrigger profileTrigger = createSampleProfileTrigger(); + assertEquals(EXPECTED_PROFILE_TRIGGER_NAME, profileTrigger.getName()); + } + + @SmallTest + public void testProfileTriggerState() { + Profile.ProfileTrigger profileTrigger = createSampleProfileTrigger(); + assertEquals(EXPECTED_PROFILE_TRIGGER_STATE, profileTrigger.getState()); + } + + @SmallTest + public void testProfileTriggerType() { + Profile.ProfileTrigger profileTrigger = createSampleProfileTrigger(); + assertEquals(EXPECTED_PROFILE_TRIGGER_STATE, profileTrigger.getType()); + } } |