ShipProductTests and ShipModCatalogTests capture Console through ConsoleProbe.Capture so restores cannot interleave
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
eee5f213bf
commit
58c4fa10c1
3 changed files with 23 additions and 18 deletions
|
|
@ -546,12 +546,8 @@ public sealed class ShipModCatalogTests : IDisposable
|
|||
|
||||
private static (int Code, string Output, string Error) Run(params string[] args)
|
||||
{
|
||||
var (output, error) = (new StringWriter(), new StringWriter());
|
||||
var (previousOut, previousError) = (Console.Out, Console.Error);
|
||||
Console.SetOut(output);
|
||||
Console.SetError(error);
|
||||
try { return (ShipAuthoringCommands.Run(args), output.ToString(), error.ToString()); }
|
||||
finally { Console.SetOut(previousOut); Console.SetError(previousError); }
|
||||
var code = ConsoleProbe.Capture(() => ShipAuthoringCommands.Run(args), out var output, out var error);
|
||||
return (code, output, error);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in a new issue