burrow/src/test/java/io/rudefox/cold/mnemonic_8_sided_dice_tests...

64 lines
2.3 KiB
Java

package io.rudefox.cold;
import com.bjdweck.test.CliTestFixture;
import org.junit.jupiter.api.Test;
import java.io.UnsupportedEncodingException;
class mnemonic_8_sided_dice_tests extends CliTestFixture {
@Test
void with_arguments_interactive_8_sided_dice_should_generate_mnemonic_sentence() throws UnsupportedEncodingException {
withArgs("mnemonic -i8 --bits 128");
expectedOutput("Input 11 x 8-sided dice rolls [1-8]: ");
provideInput("12345678123" + EOL);
expectedOutput(EOL);
expectedOutput("| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 |" + EOL);
expectedOutput("|000 001 010 01 | 1 100 101 110 1 | 11 000 001 010|" + EOL);
expectedOutput("| 1. ahead | 2. slight | 3. scout |" + EOL);
expectedOutput(EOL);
expectedOutput("Input 11 x 8-sided dice rolls [1-8]: ");
provideInput("12345678123" + EOL);
expectedOutput(EOL);
expectedOutput("| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 |" + EOL);
expectedOutput("|000 001 010 01 | 1 100 101 110 1 | 11 000 001 010|" + EOL);
expectedOutput("| 4. ahead | 5. slight | 6. scout |" + EOL);
expectedOutput(EOL);
expectedOutput("Input 11 x 8-sided dice rolls [1-8]: ");
provideInput("12345678123" + EOL);
expectedOutput(EOL);
expectedOutput("| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 |" + EOL);
expectedOutput("|000 001 010 01 | 1 100 101 110 1 | 11 000 001 010|" + EOL);
expectedOutput("| 7. ahead | 8. slight | 9. scout |" + EOL);
expectedOutput(EOL);
expectedOutput("Input 11 x 8-sided dice rolls [1-8]: ");
provideInput("12345678123" + EOL);
expectedOutput(EOL);
expectedOutput("| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 |" + EOL);
expectedOutput("|000 001 010 01 | 1 100 101 110 1 | 11 000 00- ---|" + EOL);
expectedOutput("| 10. ahead | 11. slight | 12. CHECKWORD |" + EOL);
expectedOutput(EOL);
expectedOutput("ahead slight scout ahead slight scout ahead slight scout ahead slight scan" + EOL);
doMain();
verifyOutput();
}
private void doMain() {
setInput();
RudefoxCold.main(getArgs());
}
}