I wonder how I can write a test for a specific exception statement?
For example, (test data container):
@Parameters(name = "{index}: {0} > {1} > {2} > {3} > {4}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][] {
{"1200", new byte[] {0x4B0}, "1200", 16, 2},
{"10", new byte[] {0x0A}, "10", 8, 1},
{"13544k0", new byte[] {0x0A}, "1200", 8, 1}, <== assert thrown exception
{"132111115516", new byte[] {0x0A}, "1200", 8, 1},<== assert thrown exception
});
}
Is it possible to use such container data to state an exception, or do I need to model the situation in a specific test method?
source
share