|
@ -148,22 +148,27 @@ public class VaultTest { |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void openSetNumbersMenuItem() { |
|
|
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
|
|
|
vlt.inputS = new ByteArrayInputStream("h\nyes".getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
|
vlt.outputS = outputStream; |
|
|
|
|
|
vlt.configure(); |
|
|
|
|
|
assertTrue(vlt.hasNumbers = true); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
void setNumbersTest() { |
|
|
void setNumbersTest() { |
|
|
vlt.inputS = new ByteArrayInputStream("yes\n".getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
|
|
vlt.outputS = outputStream; |
|
|
vlt.outputS = outputStream; |
|
|
vlt.SetNumbers(); |
|
|
|
|
|
|
|
|
vlt.setNumbers("yes"); |
|
|
|
|
|
|
|
|
assertTrue(outputStream.toString().startsWith("Should")); |
|
|
|
|
|
assertTrue(vlt.hasNumbers = true); |
|
|
assertTrue(vlt.hasNumbers = true); |
|
|
assertTrue(outputStream.toString().contains("contain")); |
|
|
assertTrue(outputStream.toString().contains("contain")); |
|
|
|
|
|
|
|
|
vlt.inputS = new ByteArrayInputStream("no\n".getBytes(StandardCharsets.UTF_8)); |
|
|
|
|
|
vlt.outputS = outputStream; |
|
|
vlt.outputS = outputStream; |
|
|
vlt.SetNumbers(); |
|
|
|
|
|
|
|
|
vlt.setNumbers("no"); |
|
|
|
|
|
|
|
|
assertTrue(outputStream.toString().startsWith("Should")); |
|
|
|
|
|
assertFalse(vlt.hasNumbers = false); |
|
|
assertFalse(vlt.hasNumbers = false); |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
assertTrue(outputStream.toString().contains("don´t")); |
|
|
} |
|
|
} |
|
|