-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f829be
commit ad82723
Showing
8 changed files
with
11,790 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
Sources/sdk/src/test/java/com/batch/android/messaging/model/BatchMessageActionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.batch.android.messaging.model; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import androidx.test.filters.MediumTest; | ||
import com.batch.android.BatchMessageAction; | ||
import com.batch.android.di.DITest; | ||
import com.batch.android.json.JSONException; | ||
import com.batch.android.json.JSONObject; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@MediumTest | ||
public class BatchMessageActionTest extends DITest { | ||
|
||
@Test | ||
public void testIsDismissibleAction() throws JSONException { | ||
Action isCallback = new Action("callback", new JSONObject()); | ||
BatchMessageAction isCallbackAction = new BatchMessageAction(isCallback); | ||
|
||
Action isDismissibleActionWithNil = new Action(null, new JSONObject()); | ||
BatchMessageAction isDismissibleActionWithNilAction = new BatchMessageAction(isDismissibleActionWithNil); | ||
|
||
Action isDismissibleActionWithDismiss = new Action("batch.dismiss", new JSONObject()); | ||
BatchMessageAction isDismissibleActionWithDismissAction = new BatchMessageAction( | ||
isDismissibleActionWithDismiss | ||
); | ||
|
||
assertFalse("Should not be a dismissible action because it is a callback", isCallback.isDismissAction()); | ||
assertFalse("Should not be a dismissible action because it is a callback", isCallbackAction.isDismissAction()); | ||
|
||
assertTrue( | ||
"Should be a dismissible action because it is a null action", | ||
isDismissibleActionWithNil.isDismissAction() | ||
); | ||
assertTrue( | ||
"Should be a dismissible action because it is a null action", | ||
isDismissibleActionWithNilAction.isDismissAction() | ||
); | ||
assertTrue( | ||
"Should be a dismissible action because it is Batch dismiss action", | ||
isDismissibleActionWithDismiss.isDismissAction() | ||
); | ||
assertTrue( | ||
"Should be a dismissible action because it is Batch dismiss action", | ||
isDismissibleActionWithDismissAction.isDismissAction() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
908e111c033e92d786a3c6b8b785553d50f91875 public-sdk/Batch.aar |
Oops, something went wrong.