Android Open Source - line-chart-view Line Chart View Test






From Project

Back to project page line-chart-view.

License

The source code is released under:

MIT License

If you think the Android project line-chart-view listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.hogel.android.linechartview;
/* www  .  j av  a  2  s .com*/
import org.junit.Test;
import org.robolectric.annotation.Config;

import java.util.List;

import static org.fest.assertions.api.Assertions.assertThat;

@Config(emulateSdk = 18)
public class LineChartViewTest extends ViewTestBase {
    private List<LineChartView.Point> points;

    @Override
    public void setUp() throws Exception {
        super.setUp();
    }

    @Test
    public void createSuccess() {
        LineChartView lineChartView = new LineChartView(activity);

        lineChartView.setManualMinX(0);
        lineChartView.setManualMaxX(1000);
        assertThat(lineChartView.getXGridUnit()).isGreaterThan(0);

        lineChartView.setManualMinY(0);
        lineChartView.setManualMaxY(1000);
        assertThat(lineChartView.getXGridUnit()).isGreaterThan(0);
    }

    @Test
    public void createFailure() {
        try {
            new LineChartView(null);
            assertThat(true).isFalse();
        } catch (Exception e) {
        }
    }
}




Java Source Code List

org.hogel.android.linechartview.DateLineChartView.java
org.hogel.android.linechartview.LineChartStyle.java
org.hogel.android.linechartview.LineChartViewTest.java
org.hogel.android.linechartview.LineChartView.java
org.hogel.android.linechartview.ViewTestBase.java
org.hogel.android.linechartviewdemo.DateLineChartActivity.java
org.hogel.android.linechartviewdemo.LineChartActivity.java
org.hogel.android.linechartviewdemo.MainActivity.java