Commit e67903a5 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

unit tests should use valid input data

parent feb648f9
......@@ -264,7 +264,10 @@ public class CellDesignerLineTransformationTest {
@Test
public void testGetPointsFromInvalidLine3() {
try {
lineTransformation.getPointsFromLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
PolylineData line = new PolylineData();
line.getPoints().add(new Point2D.Double());
line.getPoints().add(new Point2D.Double());
lineTransformation.getPointsFromLine(line);
fail("Excepiton expceted");
} catch (InvalidArgumentException e) {
assertTrue(e.getMessage().contains("First and last point in the line must differ but found"));
......
......@@ -46,7 +46,7 @@ public class PolylineDataFactoryTest {
PolylineData line = new PolylineData();
line.addPoint(new Point2D.Double(10, 20));
line.addPoint(new Point2D.Double(10, 30));
line.addPoint(new Point2D.Double(10, 40));
line.addPoint(new Point2D.Double(10, 35));
line.addPoint(new Point2D.Double(10, 40));
PolylineData modifiedLine = PolylineDataFactory.removeCollinearPoints(line);
assertEquals(2, modifiedLine.getPoints().size());
......
......@@ -253,7 +253,7 @@ public class ReactionToXmlTest extends CellDesignerTestFunctions {
// this test checks currently not used part of the code (for test coverage
// purpose)
String xml = toXmlParser.getConnectSchemeXmlStringForLines(
new PolylineData[] { new PolylineData(new Point2D.Double(), new Point2D.Double()), new PolylineData() });
new PolylineData[] { new PolylineData(new Point2D.Double(0,0), new Point2D.Double(1,0)), new PolylineData() });
assertTrue(xml.contains("arm"));
}
......
......@@ -132,8 +132,8 @@ public class ModifierTypeUtilsTest {
Reaction reaction = new Reaction();
Reactant reactant = new Reactant();
Product product = new Product();
reactant.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
product.setLine(new PolylineData(new Point2D.Double(), new Point2D.Double()));
reactant.setLine(new PolylineData(new Point2D.Double(0, 0), new Point2D.Double(1, 0)));
product.setLine(new PolylineData(new Point2D.Double(12, 0), new Point2D.Double(13, 0)));
reaction.addReactant(reactant);
reaction.addProduct(product);
reaction.setLine(new PolylineData(new Point2D.Double(1, 0), new Point2D.Double(12, 0)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment