-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use MockTextTerminal #33
Comments
Hi! What testing framework do you use? JUnit4? JUnit5? Spock? TestNG? |
I put up an example project that shows how to use the MockTextTerminal with JUnit 5. |
Hi. |
Did you see the example project I put up yesterday? |
Sorry, I read just the comment about the test framework and I missed the next one ;) Thank you. |
Hi. Nevermind. I can of course fetch the properties and assert that they're there. |
Hi. Edit: @Override
public void executeWithPropertiesConfigurator(Consumer<TerminalProperties<?>> propertiesConfigurator, Consumer<TextTerminal<MockTextTerminal>> action) {
final Consumer<TerminalProperties<?>> propertiesHolder = terminalProperties -> {
propertiesConfigurator.accept(terminalProperties);
lastUsedProperties = new TerminalProperties<>(this);
terminalProperties.getAllKeys().forEach(key -> lastUsedProperties.put(key, terminalProperties.getString(key)));
};
super.executeWithPropertiesConfigurator(propertiesHolder, action);
} which works but it's not super nice (and not thread safe). |
Hi.
Can you please provide some documentation or guidance on how to use the MockTextTerminal?
I would like to unit-test my business logic and the example in the repository with the Robot is not really adequate for unit tests (given the definition of unit test).
Kind regards and thanks in advance.
The text was updated successfully, but these errors were encountered: