public void cannot_parse_invalid_input(string input) { var result = ExerciseProgramParser .GetParser( new AudioServiceMock(MockBehavior.Loose), new DelayServiceMock(MockBehavior.Loose), new SpeechServiceMock(MockBehavior.Loose))(new Input(input)); Assert.False(result.WasSuccessful && result.Remainder.AtEnd); }
public void can_parse_name(string input, string expectedName) { var result = ExerciseProgramParser .GetParser( new AudioServiceMock(MockBehavior.Loose), new DelayServiceMock(MockBehavior.Loose), new SpeechServiceMock(MockBehavior.Loose)) .Parse(input); Assert.NotNull(result); Assert.Equal(expectedName, result.Name); }
public void can_parse_exercises(string input, int expectedExerciseCount) { var result = ExerciseProgramParser .GetParser( new AudioServiceMock(MockBehavior.Loose), new DelayServiceMock(MockBehavior.Loose), new SpeechServiceMock(MockBehavior.Loose)) .Parse(input); Assert.NotNull(result); Assert.Equal(expectedExerciseCount, result.Exercises.Count); }
public void get_parser_throws_if_speech_service_is_null() { Assert.Throws <ArgumentNullException>(() => ExerciseProgramParser.GetParser(new AudioServiceMock(), new DelayServiceMock(), new LoggerServiceMock(), null)); }