Skip to content

Commit

Permalink
Merge pull request google#737 from hayesjordan/unit-tests
Browse files Browse the repository at this point in the history
Unit tests for Utils
  • Loading branch information
hayesjordan authored Sep 23, 2016
2 parents d51cbde + 19afdea commit 1c174c7
Show file tree
Hide file tree
Showing 4 changed files with 545 additions and 2 deletions.
2 changes: 2 additions & 0 deletions android/PhysicalWeb/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ dependencies {
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.youview:tinydnssd:1.2.7'
compile 'org.nanohttpd:nanohttpd:2.3.0'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'

checkstyleRules files('config/checkstyle/checkstyle.xml')
findbugsRules files('config/findbugs/exclude-filter.xml')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ public static void hideAllMenuItems(Menu menu) {

/**
* Check if URL has been favorited.
* @param siteUrl.
* @param siteUrl
*/
public static boolean isFavorite(String siteUrl) {
return mFavoriteUrls.contains(siteUrl);
}

/**
* Toggles favorite status.
* @param siteUrl.
* @param siteUrl
*/
public static void toggleFavorite(String siteUrl) {
if (isFavorite(siteUrl)) {
Expand Down Expand Up @@ -506,6 +506,8 @@ public void connect(Context context) {
*/
public static String formatEndpointForSharedPrefernces(String pwsUrl, int pwsVersion,
String apiKey) {
pwsUrl = pwsUrl == null ? "" : pwsUrl;
apiKey = apiKey == null ? "" : apiKey;
return pwsUrl + SEPARATOR + pwsVersion + SEPARATOR + apiKey;
}

Expand Down
Loading

0 comments on commit 1c174c7

Please sign in to comment.