@@ -24,15 +24,15 @@ private enum PromptType {
2424 private final LinkedList <String > textPrompts ;
2525 private final LinkedList <String > passwordPrompts ;
2626 private final LinkedList <Boolean > confirmationPrompts ;
27- private int expectedPromptCount ;
27+ private int usedPromptCount ;
2828
2929 public TestIo () {
3030 printedText = new StringBuilder ();
3131 textPrompts = new LinkedList <>();
3232 promptOrder = new LinkedList <>();
3333 passwordPrompts = new LinkedList <>();
3434 confirmationPrompts = new LinkedList <>();
35- expectedPromptCount = 0 ;
35+ usedPromptCount = 0 ;
3636 }
3737
3838 public void assertContains (String contains ) {
@@ -55,9 +55,9 @@ public void assertAllPromptsUsed() {
5555 if (!allPromptsUsed ()) {
5656 fail (
5757 "Program should have created "
58- + expectedPromptCount
59- + " prompts instead of "
6058 + promptOrder .size ()
59+ + " prompts instead of "
60+ + usedPromptCount
6161 + " prompts." );
6262 }
6363 }
@@ -132,7 +132,6 @@ private <T> void addPrompt(PromptType type, T value) {
132132 break ;
133133 }
134134 promptOrder .add (type );
135- expectedPromptCount ++;
136135 }
137136
138137 private void usePrompt (PromptType type ) {
@@ -145,6 +144,7 @@ private void usePrompt(PromptType type) {
145144 throw new AssertionError (
146145 "Wrong prompt type expected " + expected .name () + ", got " + type );
147146 }
147+ usedPromptCount ++;
148148 }
149149
150150 private boolean allPromptsUsed () {
0 commit comments