Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        private static TestCaptures InjectTestCaptures(AppRunner runner)
        {
            var outputs = new TestCaptures();

            runner.Configure(c =>
            {
                c.Services.Add(outputs);
                c.UseMiddleware(InjectTestCaptures, MiddlewareStages.PostBindValuesPreInvoke);
            });

            return(outputs);
        }
Exemplo n.º 3
0
 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;
 }