예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void get_parser_throws_if_speech_service_is_null()
 {
     Assert.Throws <ArgumentNullException>(() => PrepareActionParser.GetParser(new DelayServiceMock(), null));
 }
예제 #4
0
 public void get_parser_throws_if_delay_service_is_null()
 {
     Assert.Throws <ArgumentNullException>(() => PrepareActionParser.GetParser(null, new SpeechServiceMock()));
 }