Beispiel #1
0
    public CommandLineParserTests(ITestOutputHelper output)
    {
        KernelCommandEnvelope.RegisterDefaults();
        KernelEventEnvelope.RegisterDefaults();

        _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));
        },
            startKernelHost: (startupOptions, host, 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.RegisterDefaults();
     KernelEventEnvelope.RegisterDefaults();
     Kernel?.Dispose();
     _host.Value.Dispose();
     _host = null;
 }