private void TestShowItemCore(IRunnerRepository inRepo, params string[] inExpected) { var it = inExpected.GetEnumerator(); var runner = inRepo.FindRunner(new ShowItemParseResult(), (message) => { Assert.That(it.MoveNext(), Is.True); Assert.That(message, Is.EqualTo(it.Current)); }); runner(); Assert.That(it.MoveNext(), Is.False); }
private bool ProcessCommand() { var command = ReadCommand(); if (command == TerminateCommand) { return(false); } var parser = mParserRepo.FindParser(command); var parseResult = parser(); var runner = mRunnerRepo.FindRunner(parseResult, this.LogUpdated); runner(); return(true); }
private void TestShowItemCore(IRunnerRepository inRepo, params string[] inExpected) { var it = inExpected.GetEnumerator(); var runner = inRepo.FindRunner(new ShowItemParseResult(), (message) => { Assert.That(it.MoveNext(), Is.True); Assert.That(message, Is.EqualTo(it.Current)); }); runner(); Assert.That(it.MoveNext(), Is.False); }