public void cannot_parse_invalid_input(string input) { var result = PrepareActionParser.GetParser( new DelayServiceMock(MockBehavior.Loose), new SpeechServiceMock(MockBehavior.Loose))(new Input(input)); Assert.False(result.WasSuccessful && result.Remainder.AtEnd); }
public void can_parse_valid_input(string input, int expectedMilliseconds) { var result = PrepareActionParser.GetParser( new DelayServiceMock(MockBehavior.Loose), new SpeechServiceMock(MockBehavior.Loose)).Parse(input); Assert.Equal(TimeSpan.FromMilliseconds(expectedMilliseconds), result.Duration); }
public void get_parser_throws_if_speech_service_is_null() { Assert.Throws <ArgumentNullException>(() => PrepareActionParser.GetParser(new DelayServiceMock(), null)); }
public void get_parser_throws_if_delay_service_is_null() { Assert.Throws <ArgumentNullException>(() => PrepareActionParser.GetParser(null, new SpeechServiceMock())); }