Created
February 25, 2019 20:06
-
-
Save jonbodner/ec77588c7d936b675297e0214a471aae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Parameters(name = "{index}: CalculatorTest({0})={1}, throws {2}") | |
public static Collection<Object[]> data() { | |
return Arrays.asList(new Object[][]{ | |
{"1 + 1", 2, null}, | |
{"1 + 1 + 1", 3, null}, | |
{"1–1", 0, null}, | |
{"1 * 1", 1, null}, | |
{"1 / 1", 1, null}, | |
{"( 1 + 1 )", 2, null}, | |
{"+", 0, new CalculatorException("Invalid expression: +")}, | |
{"1 1", 0, new CalculatorException("Invalid expression: 1 1")}, | |
{"1 / 1 * 1 ", 1, null}, | |
{"( 1–1 )", 0, null}, | |
{"( 1 + 1–1 * 1 / 1 )", 1, null}, | |
{"( 1 + 1 * 1 )", 2, null}, | |
{"1 ( 1", 0, new CalculatorException("Invalid expression: 1 ( 1")}, | |
{"1 + + 1", 0, new CalculatorException("Invalid expression: 1 + + 1")} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment