forked from mozilla-mobile/fenix
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For mozilla-mobile#27055: check whether applied wallpaper name is blank
- Loading branch information
1 parent
16f490e
commit 414c569
Showing
3 changed files
with
37 additions
and
1 deletion.
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
28 changes: 28 additions & 0 deletions
28
app/src/test/java/org/mozilla/fenix/wallpapers/WallpaperTest.kt
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,28 @@ | ||
package org.mozilla.fenix.wallpapers | ||
|
||
import org.junit.Assert.assertFalse | ||
import org.junit.Assert.assertTrue | ||
import org.junit.Test | ||
|
||
class WallpaperTest { | ||
@Test | ||
fun `GIVEN blank wallpaper name WHEN checking whether is default THEN is default`() { | ||
val result = Wallpaper.nameIsDefault("") | ||
|
||
assertTrue(result) | ||
} | ||
|
||
@Test | ||
fun `GIVEN the default wallpaper is set to be shown WHEN checking whether the current wallpaper should be default THEN return true`() { | ||
val result = Wallpaper.nameIsDefault("default") | ||
|
||
assertTrue(result) | ||
} | ||
|
||
@Test | ||
fun `GIVEN a custom wallpaper is set to be shown WHEN checking whether the current wallpaper should be default THEN return false`() { | ||
val result = Wallpaper.nameIsDefault("wally world") | ||
|
||
assertFalse(result) | ||
} | ||
} |