Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] Test token strings for icon-image and text-field
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Jul 20, 2018
1 parent 83fd1c7 commit 8ffe32a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ public void testIconImageAsConstant() {
// Set and Get
layer.setProperties(iconImage("undefined"));
assertEquals((String) layer.getIconImage().getValue(), (String) "undefined");

layer.setProperties(iconImage("{token}"));
assertEquals(layer.getIconImage().getExpression(), Expression.toString(Expression.get("token")));
});
}

Expand Down Expand Up @@ -446,6 +449,9 @@ public void testTextFieldAsConstant() {
// Set and Get
layer.setProperties(textField(""));
assertEquals((String) layer.getTextField().getValue(), (String) "");

layer.setProperties(textField("{token}"));
assertEquals(layer.getTextField().getExpression(), Expression.toString(Expression.get("token")));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ public class <%- camelize(type) %>LayerTest extends BaseActivityTest {
// Set and Get
layer.setProperties(<%- camelizeWithLeadingLowercase(property.name) %>(<%- defaultValueJava(property) %>));
assertEquals((<%- propertyType(property) %>) layer.get<%- camelize(property.name) %>().getValue(), (<%- propertyType(property) %>) <%- defaultValueJava(property) %>);
<% if (property.tokens) { -%>
layer.setProperties(<%- camelizeWithLeadingLowercase(property.name) %>("{token}"));
assertEquals(layer.get<%- camelize(property.name) %>().getExpression(), Expression.toString(Expression.get("token")));
<% } -%>
});
}
<% if (property['property-type'] === 'data-driven' || property['property-type'] === 'cross-faded-data-driven') { -%>
Expand Down

0 comments on commit 8ffe32a

Please sign in to comment.