internal void UseOutputsFromInstance(TestCaptures testCaptures) { if (Captured.Count > 0) { throw new InvalidOperationException( $"cannot link to a {nameof(TestCaptures)} that already has outputs recorded. keys:{Captured.Keys.ToOrderedCsv()}"); } Captured = testCaptures.Captured; }
private static TestCaptures InjectTestCaptures(AppRunner runner) { var outputs = new TestCaptures(); runner.Configure(c => { c.Services.Add(outputs); c.UseMiddleware(InjectTestCaptures, MiddlewareStages.PostBindValuesPreInvoke); }); return(outputs); }
public AppRunnerResult(int exitCode, AppRunner runner, CommandContext commandContext, TestConsole testConsole, TestCaptures testCaptures, TestConfig config, Exception escapedException = null) { ExitCode = exitCode; Runner = runner; CommandContext = commandContext; Console = testConsole; TestCaptures = testCaptures; Config = config; EscapedException = escapedException; }