Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Created April 30, 2019 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchtabian/e19383e70e513362f6c5b10e96ae6d07 to your computer and use it in GitHub Desktop.
Save mitchtabian/e19383e70e513362f6c5b10e96ae6d07 to your computer and use it in GitHub Desktop.
assertAll example
@Test
@DisplayName("Subtracting two numbers")
public void testSubtract1(){
assertAll(
new Executable() {
@Override
public void execute() throws Throwable {
assertEquals(3, calculator.subtract(6, 3));
}
},
new Executable() {
@Override
public void execute() throws Throwable {
assertEquals(5, calculator.subtract(5, 2));
}
},
new Executable() {
@Override
public void execute() throws Throwable {
assertEquals(9, calculator.subtract(11,1));
}
}
);
}
@Test
@DisplayName("Subtracting two numbers")
public void testSubtract1(){
assertEquals(3, calculator.subtract(6, 3));
assertEquals(5, calculator.subtract(5, 2));
assertEquals(9, calculator.subtract(11,1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment