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

Commit

Permalink
[android] #5610 - fix Color tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivovandongen committed Aug 1, 2016
1 parent db09b15 commit 5b65b31
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public void testBackgroundColor() {
assertNotNull(layer);

//Set and Get
layer.set(backgroundColor("#000000"));
assertEquals((String) layer.getBackgroundColor().getValue(), (String) "#000000");
layer.set(backgroundColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getBackgroundColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public void testCircleColor() {
assertNotNull(layer);

//Set and Get
layer.set(circleColor("#000000"));
assertEquals((String) layer.getCircleColor().getValue(), (String) "#000000");
layer.set(circleColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getCircleColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public void testFillColor() {
assertNotNull(layer);

//Set and Get
layer.set(fillColor("#000000"));
assertEquals((String) layer.getFillColor().getValue(), (String) "#000000");
layer.set(fillColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getFillColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand All @@ -154,8 +154,8 @@ public void testFillOutlineColor() {
assertNotNull(layer);

//Set and Get
layer.set(fillOutlineColor("undefined"));
assertEquals((String) layer.getFillOutlineColor().getValue(), (String) "undefined");
layer.set(fillOutlineColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getFillOutlineColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ public void testLineColor() {
assertNotNull(layer);

//Set and Get
layer.set(lineColor("#000000"));
assertEquals((String) layer.getLineColor().getValue(), (String) "#000000");
layer.set(lineColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getLineColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,8 @@ public void testIconColor() {
assertNotNull(layer);

//Set and Get
layer.set(iconColor("#000000"));
assertEquals((String) layer.getIconColor().getValue(), (String) "#000000");
layer.set(iconColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getIconColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand All @@ -880,8 +880,8 @@ public void testIconHaloColor() {
assertNotNull(layer);

//Set and Get
layer.set(iconHaloColor("rgba(0, 0, 0, 0)"));
assertEquals((String) layer.getIconHaloColor().getValue(), (String) "rgba(0, 0, 0, 0)");
layer.set(iconHaloColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getIconHaloColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand Down Expand Up @@ -1012,8 +1012,8 @@ public void testTextColor() {
assertNotNull(layer);

//Set and Get
layer.set(textColor("#000000"));
assertEquals((String) layer.getTextColor().getValue(), (String) "#000000");
layer.set(textColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getTextColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand All @@ -1034,8 +1034,8 @@ public void testTextHaloColor() {
assertNotNull(layer);

//Set and Get
layer.set(textHaloColor("rgba(0, 0, 0, 0)"));
assertEquals((String) layer.getTextHaloColor().getValue(), (String) "rgba(0, 0, 0, 0)");
layer.set(textHaloColor("rgba(0, 0, 0, 1);"));
assertEquals((String) layer.getTextHaloColor().getValue(), (String) "rgba(0, 0, 0, 1);");
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion platform/android/scripts/generate-style-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ global.defaultValueJava = function(property) {
case 'enum':
return snakeCaseUpper(property.name) + "_" + snakeCaseUpper(property.values[0]);
case 'color':
return '"' + property['default'] + '"';
return '"rgba(0, 0, 0, 1);"';
case 'array':
switch (property.value) {
case 'string':
Expand Down

0 comments on commit 5b65b31

Please sign in to comment.