Added Unit Test Case for ConsoleAndOut class
This commit is contained in:
parent
e9e98ecc8e
commit
efd1705136
@ -0,0 +1,27 @@
|
|||||||
|
package com.baeldung.consoleout;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
class ConsoleAndOutUnitTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void whenRetreivingConsole_thenPrintConsoleObject() {
|
||||||
|
assertThrows(NullPointerException.class, () -> {
|
||||||
|
ConsoleAndOut.printConsoleObject();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void whenReadingPassword_thenReadPassword() {
|
||||||
|
assertThrows(NullPointerException.class, () -> {
|
||||||
|
ConsoleAndOut.readPasswordFromConsole();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void whenRetrievingSysOut_thenPrintSysOutObject() {
|
||||||
|
ConsoleAndOut.printSysOut();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user