Browse Source

added setPWLength Option refactor

feature-vault
fdai6352 3 years ago
parent
commit
bc1702b935
  1. 2
      src/main/java/Vault.java
  2. 12
      src/test/java/VaultTest.java

2
src/main/java/Vault.java

@ -39,7 +39,7 @@ public class Vault implements VaultInterface {
}
public void setPWLength(){
println("Set PW length:");
}

12
src/test/java/VaultTest.java

@ -1,6 +1,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -38,9 +39,6 @@ public class VaultTest {
@Test
void loadFromJson() {vlt.loadFromJson();}
@Test
void setPWLength() {vlt.setPWLength();}
@Test
void openConfigureMenu() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
@ -71,7 +69,13 @@ public class VaultTest {
assertTrue(outputStream.toString().startsWith("Configure:"));
}
@Test
void openSetPWLength() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
vlt.outputS = outputStream;
vlt.setPWLength();
assertTrue(outputStream.toString().startsWith("Set"));
}
private ByteArrayInputStream getEmptyStringInputStream() {
return new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8));

Loading…
Cancel
Save