public CommandLineParserTests(ITestOutputHelper output) { KernelCommandEnvelope.ResetToDefaults(); KernelEventEnvelope.ResetToDefaults(); _output = output; _serviceCollection = new ServiceCollection(); _parser = CommandLineParser.Create( _serviceCollection, startServer: (options, invocationContext) => { _startOptions = options; }, jupyter: (startupOptions, console, startServer, context) => { _startOptions = startupOptions; return(Task.FromResult(1)); }, startStdIO: (startupOptions, kernel, console) => { _startOptions = startupOptions; return(Task.FromResult(1)); }, startHttp: (startupOptions, console, startServer, context) => { _startOptions = startupOptions; return(Task.FromResult(1)); }, telemetry: new FakeTelemetry(), firstTimeUseNoticeSentinel: new NopFirstTimeUseNoticeSentinel()); _connectionFile = new FileInfo(Path.GetTempFileName()); _kernelSpecInstallPath = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); }
public void Dispose() { KernelCommandEnvelope.ResetToDefaults(); KernelEventEnvelope.ResetToDefaults(); _host.Value.Dispose(); _host = null; }