@Test public void noArgs() throws Exception { makeScenarioTable("|scenario|myScenario|\n"); assertEquals("myScenario", st.getName()); assertEquals(0, st.getInputs().size()); assertEquals(0, st.getOutputs().size()); assertFalse(st.isParameterized()); }
@Test public void oneInputArgWithTrailingName() throws Exception { makeScenarioTable("|scenario|myScenario|input|trailer|\n"); assertEquals("MyScenarioTrailer", st.getName()); Set<String> inputs = st.getInputs(); assertEquals(1, inputs.size()); assertTrue(inputs.contains("input")); assertEquals(0, st.getOutputs().size()); assertFalse(st.isParameterized()); }
@Test public void manyInputsWithTrailer() throws Exception { makeScenarioTable("|scenario|login user|user name|with password|password|now|\n"); assertEquals("LoginUserWithPasswordNow", st.getName()); Set<String> inputs = st.getInputs(); assertEquals(2, inputs.size()); assertTrue(inputs.contains("userName")); assertTrue(inputs.contains("password")); assertEquals(0, st.getOutputs().size()); assertFalse(st.isParameterized()); }
@Test public void manyInputsAndOutputs() throws Exception { makeScenarioTable( "|scenario|login user|user name|with password|password|giving message|message?|and status|login status?|\n"); assertEquals("LoginUserWithPasswordGivingMessageAndStatus", st.getName()); Set<String> inputs = st.getInputs(); assertEquals(2, inputs.size()); assertTrue(inputs.contains("userName")); assertTrue(inputs.contains("password")); Set<String> outputs = st.getOutputs(); assertEquals(2, outputs.size()); assertTrue(outputs.contains("message")); assertTrue(outputs.contains("loginStatus")); assertFalse(st.isParameterized()); }