forked from google/iosched
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add double quotes to wifi config's SSID and password when saving.
Bug: 79314491 Test: WifiConfigurationStringsTest Change-Id: If41fe437ca06fe3a6fa41b582e08666d81c5b48a
- Loading branch information
Doug Sigelbaum
committed
May 7, 2018
1 parent
d0b0b83
commit 445c9f8
Showing
3 changed files
with
148 additions
and
7 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
86 changes: 86 additions & 0 deletions
86
mobile/src/test/java/com/google/samples/apps/iosched/util/WifiConfigurationStringsTest.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,86 @@ | ||
package com.google.samples.apps.iosched.util | ||
|
||
import junit.framework.Assert.assertEquals | ||
import org.junit.Test | ||
|
||
class WifiConfigurationStringsTest { | ||
@Test | ||
fun testWrapQuotes_emptyString() { | ||
val original = "" | ||
val expected = "\"\"" | ||
val quoted = original.wrapInQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
|
||
@Test | ||
fun testWrapQuotes_alreadyQuotes() { | ||
val original = "\"io2018\"" | ||
val expected = "\"io2018\"" | ||
val quoted = original.wrapInQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
|
||
@Test | ||
fun testWrapQuotes_noQuotes() { | ||
val original = "io2018" | ||
val expected = "\"io2018\"" | ||
val quoted = original.wrapInQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
|
||
@Test | ||
fun testWrapQuotes_oneStartingQuote() { | ||
val original = "\"io2018" | ||
val expected = "\"io2018\"" | ||
val quoted = original.wrapInQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
|
||
@Test | ||
fun testWrapQuotes_oneEndingQuote() { | ||
val original = "io2018\"" | ||
val expected = "\"io2018\"" | ||
val quoted = original.wrapInQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
|
||
@Test | ||
fun testUnwrapQuotes_emptyString() { | ||
val original = "" | ||
val expected = "" | ||
val unquoted = original.unwrapQuotes() | ||
assertEquals(expected, unquoted) | ||
} | ||
|
||
@Test | ||
fun testUnwrapQuotes_alreadyQuotes() { | ||
val original = "\"io2018\"" | ||
val expected = "io2018" | ||
val unquoted = original.unwrapQuotes() | ||
assertEquals(expected, unquoted) | ||
} | ||
|
||
@Test | ||
fun testUnwrapQuotes_noQuotes() { | ||
val original = "io2018" | ||
val expected = "io2018" | ||
val unquoted = original.unwrapQuotes() | ||
assertEquals(expected, unquoted) | ||
} | ||
|
||
@Test | ||
fun testUnwrapQuotes_oneStartingQuote() { | ||
val original = "\"io2018" | ||
val expected = "io2018" | ||
val quoted = original.unwrapQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
|
||
@Test | ||
fun testUnwrapQuotes_oneEndingQuote() { | ||
val original = "io2018\"" | ||
val expected = "io2018" | ||
val quoted = original.unwrapQuotes() | ||
assertEquals(expected, quoted) | ||
} | ||
} |