示例#1
0
        public async Task InitializeAsync_ConfiguresEnvironmentVariables()
        {
            // Arrange
            var applier = new DefaultDeltaApplier(Mock.Of <IReporter>())
            {
                SuppressNamedPipeForTests = true
            };
            var process = new ProcessSpec();
            var fileSet = new FileSet(null, new[]
            {
                new FileItem {
                    FilePath = "Test.cs"
                },
            });
            var context = new DotNetWatchContext {
                ProcessSpec = process, FileSet = fileSet, Iteration = 0
            };

            // Act
            await applier.InitializeAsync(context, default);

            // Assert
            Assert.Equal("debug", process.EnvironmentVariables["DOTNET_MODIFIABLE_ASSEMBLIES"]);
            Assert.NotEmpty(process.EnvironmentVariables["DOTNET_HOTRELOAD_NAMEDPIPE_NAME"]);
            Assert.NotEmpty(process.EnvironmentVariables.DotNetStartupHooks);
        }
        public async ValueTask InitializeAsync(DotNetWatchContext context, CancellationToken cancellationToken)
        {
            await _wasmApplier.InitializeAsync(context, cancellationToken);

            await _hostApplier.InitializeAsync(context, cancellationToken);
        }