use of com.vaadin.flow.component.charts.events.HasItem in project flow-components by vaadin.
the class HasItemTest method getSeries.
@Test
public void getSeries() {
Chart chart = new Chart();
DataSeries series = new DataSeries();
chart.getConfiguration().addSeries(series);
HasItem hasItem = new HasItemTestImpl(chart, 0, 0);
Series result = hasItem.getSeries();
Assert.assertEquals(series, result);
}
use of com.vaadin.flow.component.charts.events.HasItem in project flow-components by vaadin.
the class HasItemTest method getItemWithListSeriesThrowsUnsupportedOperationException.
@Test(expected = UnsupportedOperationException.class)
public void getItemWithListSeriesThrowsUnsupportedOperationException() {
Chart chart = new Chart();
ListSeries series = new ListSeries(1, 2, 3);
chart.getConfiguration().addSeries(series);
HasItem hasItem = new HasItemTestImpl(chart, 0, 0);
hasItem.getItem();
}
use of com.vaadin.flow.component.charts.events.HasItem in project flow-components by vaadin.
the class HasItemTest method getItemWithDataSeries.
@Test
public void getItemWithDataSeries() {
Chart chart = new Chart();
DataSeriesItem item = new DataSeriesItem(5, 10);
DataSeries series = new DataSeries(item);
chart.getConfiguration().addSeries(series);
HasItem hasItem = new HasItemTestImpl(chart, 0, 0);
DataSeriesItem result = hasItem.getItem();
Assert.assertEquals(item, result);
}
use of com.vaadin.flow.component.charts.events.HasItem in project flow-components by vaadin.
the class HasItemTest method getItemWithNodeSeriesThrowsUnsupportedOperationException.
@Test(expected = UnsupportedOperationException.class)
public void getItemWithNodeSeriesThrowsUnsupportedOperationException() {
Chart chart = new Chart();
Node node1 = new Node("Node1");
Node node2 = new Node("Node2");
NodeSeries series = new NodeSeries();
series.add(node1, node2);
chart.getConfiguration().addSeries(series);
HasItem hasItem = new HasItemTestImpl(chart, 0, 0);
hasItem.getItem();
}
use of com.vaadin.flow.component.charts.events.HasItem in project flow-components by vaadin.
the class HasItemTest method getItemWithTreeSeriesThrowsUnsupportedOperationException.
@Test(expected = UnsupportedOperationException.class)
public void getItemWithTreeSeriesThrowsUnsupportedOperationException() {
Chart chart = new Chart();
TreeSeriesItem item = new TreeSeriesItem("1", "1");
TreeSeries series = new TreeSeries();
series.add(item);
chart.getConfiguration().addSeries(series);
HasItem hasItem = new HasItemTestImpl(chart, 0, 0);
hasItem.getItem();
}
Aggregations