Created
April 30, 2019 15:13
-
-
Save mitchtabian/e19383e70e513362f6c5b10e96ae6d07 to your computer and use it in GitHub Desktop.
assertAll example
This file contains 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
@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)); | |
} | |
} | |
); | |
} |
This file contains 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
@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