Update tests
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@@ -19,6 +19,7 @@
|
||||
|
||||
package org.isoron.uhabits.unit.views;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
|
||||
@@ -42,10 +43,11 @@ public class RingViewTest extends ViewTest
|
||||
super.setup();
|
||||
|
||||
view = new RingView(targetContext);
|
||||
// view.setLabel("Hello world");
|
||||
view.setPercentage(0.6f);
|
||||
view.setText("60%");
|
||||
view.setColor(ColorHelper.CSV_PALETTE[0]);
|
||||
// view.setMaxDiameter(dpToPixels(100));
|
||||
view.setBackgroundColor(Color.WHITE);
|
||||
view.setThickness(dpToPixels(3));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,21 +57,10 @@ public class RingViewTest extends ViewTest
|
||||
assertRenders(view, "RingView/render.png");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRender_withLongLabel() throws IOException
|
||||
{
|
||||
// view.setLabel("The quick brown fox jumps over the lazy fox");
|
||||
|
||||
measureView(dpToPixels(100), dpToPixels(100), view);
|
||||
assertRenders(view, "RingView/renderLongLabel.png");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRender_withDifferentParams() throws IOException
|
||||
{
|
||||
// view.setLabel("Habit Strength");
|
||||
view.setPercentage(0.25f);
|
||||
// view.setMaxDiameter(dpToPixels(50));
|
||||
view.setColor(ColorHelper.CSV_PALETTE[5]);
|
||||
|
||||
measureView(dpToPixels(200), dpToPixels(200), view);
|
||||
|
||||