use of de.neemann.digital.testing.parser.LineCollector in project Digital by hneemann.
the class TestDataTest method testSetDataParseable.
public void testSetDataParseable() throws Exception {
TestCaseDescription td = new TestCaseDescription(DATA1);
LineCollector cl = new LineCollector(td.getLines());
assertEquals(4, cl.getLines().size());
assertEquals(DATA1, td.getDataString());
// try to set a parsable string
td.setDataString(DATA2);
// TestData has changed!
assertEquals(DATA2, td.getDataString());
}
use of de.neemann.digital.testing.parser.LineCollector in project Digital by hneemann.
the class TestDataTest method testSetDataNonParseable.
public void testSetDataNonParseable() throws Exception {
TestCaseDescription td = new TestCaseDescription(DATA1);
LineCollector cl = new LineCollector(td.getLines());
assertEquals(4, cl.getLines().size());
assertEquals(DATA1, td.getDataString());
// try to set a non parsable string
try {
td.setDataString(DATA3);
assertTrue(false);
} catch (IOException | ParserException e) {
assertTrue(true);
}
// TestData remains unchanged!
assertEquals(DATA1, td.getDataString());
}
Aggregations