306 instantiations of TestEnvironment
Aspire.Cli.Tests (306)
Acquisition\IdentityResolverTests.cs (1)
561var environment = new TestEnvironment(environmentVariables);
Acquisition\InstallationDiscoveryDiscoverAllTests.cs (7)
586environment: new TestEnvironment(), 615environment: new TestEnvironment(), 651environment: new TestEnvironment(), 694environment: new TestEnvironment(), 824environment: new TestEnvironment(), 934environment: new TestEnvironment(), 973environment: new TestEnvironment(),
Agents\AgentTelemetryHookTests.cs (17)
23Assert.Null(AgentTelemetryHook.Classify(payload, new TestEnvironment(), AgentTelemetryHook.DefaultMaxPayloadCharacters)); 33var args = AgentTelemetryHook.Classify($$"""{"{{nameProperty}}":"{{tool}}","{{inputProperty}}":{{input}}}""", new TestEnvironment(), AgentTelemetryHook.DefaultMaxPayloadCharacters); 49new TestEnvironment(), 63var environment = new TestEnvironment(new Dictionary<string, string?> 80Assert.NotNull(AgentTelemetryHook.Classify(payload, new TestEnvironment(), payload.Length)); 81Assert.Null(AgentTelemetryHook.Classify(payload, new TestEnvironment(), payload.Length - 1)); 87var hook = new AgentTelemetryHook(new TestEnvironment()); 106var hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?> 123var args = AgentTelemetryHook.Classify("""{"toolName":"aspire-list_resources","toolArgs":"not json"}""", new TestEnvironment(), AgentTelemetryHook.DefaultMaxPayloadCharacters); 136new TestEnvironment(), AgentTelemetryHook.DefaultMaxPayloadCharacters); 155var hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?> 228new TestEnvironment(), 245new TestEnvironment(), 304var hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?> 328var hook = new AgentTelemetryHook(new TestEnvironment(new Dictionary<string, string?> 346Assert.Null(AgentTelemetryHook.Classify(padded, new TestEnvironment(), AgentTelemetryHook.DefaultMaxPayloadCharacters)); 347Assert.NotNull(AgentTelemetryHook.Classify(padded, new TestEnvironment(), padded.Length));
Agents\CopilotAgentEnvironmentScannerTests.cs (3)
56new TestEnvironment(), NullLogger<CopilotAgentEnvironmentScanner>.Instance); 79var environment = new TestEnvironment(new Dictionary<string, string?> { ["TERM_PROGRAM"] = "vscode" }); 106new FakeCopilotAppInstallationDetector(), new TestEnvironment(),
Agents\TelemetryHookConfiguratorTests.cs (1)
423var environment = new TestEnvironment(environmentVariables);
Agents\TelemetryHookScriptTests.cs (1)
550var nativeEnvironment = new TestEnvironment(environment);
Agents\VsCodeAgentEnvironmentScannerTests.cs (5)
24var scanner = new VsCodeAgentEnvironmentScanner(runner, CreateExecutionContext(workingDirectory), new TestEnvironment(), 52new TestEnvironment(), NullLogger<VsCodeAgentEnvironmentScanner>.Instance); 76CreateExecutionContext(workspace.WorkspaceRoot), new TestEnvironment(), 97var scanner = new VsCodeAgentEnvironmentScanner(runner, CreateExecutionContext(workspace.WorkspaceRoot), new TestEnvironment(), 118var environment = new TestEnvironment(new Dictionary<string, string?> { ["TERM_PROGRAM"] = "vscode" });
Backchannel\AppHostCliBackchannelTests.cs (4)
21var environment = new TestEnvironment(new Dictionary<string, string?> 70new TestEnvironment(), 103new TestEnvironment(), 127var environment = new TestEnvironment(new Dictionary<string, string?>
BundleServiceIntegrationTests.cs (2)
691await BundleService.ExtractPayloadAsync(stream, dest, new TestEnvironment(), CancellationToken.None); 862return new BundleService(provider, layoutDiscovery, new TestEnvironment(), NullLogger<BundleService>.Instance)
Caching\AppHostInfoDiskCacheTests.cs (12)
20return new AppHostInfoDiskCache(NullLogger<AppHostInfoDiskCache>.Instance, ctx, configurationService ?? new TestConfigurationService(), new TestEnvironment()); 31return new AppHostInfoDiskCache(NullLogger<AppHostInfoDiskCache>.Instance, ctx, configurationService, new TestEnvironment()); 672var key1 = AppHostInfoDiskCache.ComputeKeyAsync(new FileInfo(projectFile.FullName), new TestEnvironment()); 673var key2 = AppHostInfoDiskCache.ComputeKeyAsync(new FileInfo(projectFile.FullName), new TestEnvironment()); 685var keyA = AppHostInfoDiskCache.ComputeKeyAsync(projectA, new TestEnvironment()); 686var keyB = AppHostInfoDiskCache.ComputeKeyAsync(projectB, new TestEnvironment()); 711var keyLower = AppHostInfoDiskCache.ComputeKeyAsync(new FileInfo(lowerPath), new TestEnvironment()); 712var keyUpper = AppHostInfoDiskCache.ComputeKeyAsync(new FileInfo(upperDrivePath), new TestEnvironment()); 731var keyBeforeImport = AppHostInfoDiskCache.ComputeKeyAsync(projectFile, new TestEnvironment()); 733var keyAfterImport = AppHostInfoDiskCache.ComputeKeyAsync(new FileInfo(projectFile.FullName), new TestEnvironment()); 755var keyBeforeParentImportEdit = AppHostInfoDiskCache.ComputeKeyAsync(projectFile, new TestEnvironment()); 760var keyAfterParentImportEdit = AppHostInfoDiskCache.ComputeKeyAsync(new FileInfo(projectFile.FullName), new TestEnvironment());
CliBootstrapTests.cs (3)
379var environment = new TestEnvironment(); 413var environment = new TestEnvironment(envVars); 435var environment = new TestEnvironment();
Commands\AddCommandTests.cs (1)
1114var nuGetClient = new NuGetClient(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance)
Commands\AgentInitClientSelectionTests.cs (22)
635var environment = new TestEnvironment(); 767services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> { [variable] = value })); 791var environment = new TestEnvironment(); 841var environment = new TestEnvironment(); 896var environment = new TestEnvironment(); 934services.AddSingleton<IEnvironment>(new TestEnvironment( 961var environment = new TestEnvironment(); 1013var environment = new TestEnvironment(); 1054var environment = new TestEnvironment(new Dictionary<string, string?> { [variable] = value }); 1074var environment = new TestEnvironment(new Dictionary<string, string?> 1117var environment = new TestEnvironment(new Dictionary<string, string?> { ["OPENCODE_CONFIG"] = path }); 1147var environment = new TestEnvironment(new Dictionary<string, string?> { ["OPENCODE_CONFIG"] = path }); 1176var environment = new TestEnvironment(); 1229var environment = new TestEnvironment(); 1262var environment = new TestEnvironment(); 1292var environment = new TestEnvironment(); 1331var environment = new TestEnvironment(); 1423var environment = new TestEnvironment(); 1479services.AddSingleton<IEnvironment>(new TestEnvironment()); 1537services.AddSingleton<IEnvironment>(new TestEnvironment()); 1568services.AddSingleton<IEnvironment>(new TestEnvironment()); 1599services.AddSingleton<IEnvironment>(new TestEnvironment());
Commands\AgentTelemetryCommandTests.cs (1)
102services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\AppHostLauncherTests.cs (1)
1352executionContext, new TestEnvironment(),
Commands\ConfigSourceCommandTests.cs (8)
65services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 906services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1340services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1437services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1556services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1612services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1648services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1682services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\DashboardRunCommandTests.cs (1)
730return new TestEnvironment(envVars);
Commands\DeployCommandTests.cs (1)
432services.AddSingleton<IEnvironment>(new TestEnvironment(explicitFile
Commands\GoAppHostToolingCheckTests.cs (1)
587new TestEnvironment(environment),
Commands\NewCommandLocalTemplateTests.InitConfig.cs (2)
58services.AddSingleton<IEnvironment>(new TestEnvironment()); 309services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\NewCommandLocalTemplateTests.SourceList.cs (3)
306services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 343services.AddSingleton<IEnvironment>(new TestEnvironment()); 410services.AddSingleton<IEnvironment>(new TestEnvironment());
Commands\NewCommandLocalTemplateTests.SourceListGit.cs (1)
300services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\SecretCommandTests.cs (4)
271new TestEnvironment(new Dictionary<string, string?> { ["API_KEY"] = useEnvvarSource ? value : "not-the-positional-value" }), 425using var provider = CreateSecretTestServices(workspace, outputWriter, appHostFile, userSecretsId, new TestEnvironment(), 472new TestEnvironment(new Dictionary<string, string?> { ["API_KEY"] = "environment-secret" })); 516new TestEnvironment(new Dictionary<string, string?> { ["API_KEY"] = secretValue }),
Commands\TypeScriptAppHostToolingCheckTests.cs (1)
280new TestEnvironment(),
Commands\VsCodeExtensionCheckTests.cs (12)
18var environment = new TestEnvironment(new Dictionary<string, string?>()); 34var environment = new TestEnvironment(new Dictionary<string, string?> 64var environment = new TestEnvironment(new Dictionary<string, string?> 93var environment = new TestEnvironment(new Dictionary<string, string?> 118var environment = new TestEnvironment(new Dictionary<string, string?> 139var environment = new TestEnvironment(new Dictionary<string, string?> 160var environment = new TestEnvironment(new Dictionary<string, string?>()); 174var environment = new TestEnvironment(new Dictionary<string, string?>()); 190var environment = new TestEnvironment(new Dictionary<string, string?> 209var environment = new TestEnvironment(new Dictionary<string, string?> 231var environment = new TestEnvironment(new Dictionary<string, string?> 252var environment = new TestEnvironment(new Dictionary<string, string?>
Configuration\ConfigSourceServiceTests.cs (14)
34var environment = new TestEnvironment(new Dictionary<string, string?> 96var environment = new TestEnvironment(new Dictionary<string, string?> 124var environment = new TestEnvironment(new Dictionary<string, string?> 182var environment = new TestEnvironment(new Dictionary<string, string?> 829environment: new TestEnvironment(new Dictionary<string, string?> 851environment: new TestEnvironment(new Dictionary<string, string?> 914var environment = new TestEnvironment(new Dictionary<string, string?> 942environment: new TestEnvironment(new Dictionary<string, string?> 974environment: new TestEnvironment(new Dictionary<string, string?> 995environment: new TestEnvironment(new Dictionary<string, string?> 1032var environment = new TestEnvironment(new Dictionary<string, string?> 1284var environment = new TestEnvironment(new Dictionary<string, string?> 2001var environment = new TestEnvironment(new Dictionary<string, string?> 2032var environment = new TestEnvironment(new Dictionary<string, string?>
Configuration\DotNetBasedAppHostServerChannelResolutionTests.cs (1)
118new TestEnvironment(),
Configuration\PrebuiltAppHostServerChannelResolutionTests.cs (1)
109new TestEnvironment(),
DotNet\DotNetCliRunnerTests.cs (3)
108new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance); 172new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance); 1038new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance);
DotNet\OwnedProcessExecutionTests.cs (1)
26var factory = new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance);
DotNet\ProcessExecutionDetachedTests.cs (1)
129var factory = new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance);
DotNet\ProcessExecutionFactoryEnvironmentTests.cs (2)
38var factory = new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), logger); 209=> new(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance);
DotNet\ProcessExecutionTests.cs (2)
231new TestEnvironment(), loggerFactory.CreateLogger<ProcessExecutionFactory>()).CreateExecution( 353var factory = new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance);
DotNetSdkInstallerTests.cs (2)
33var environment = new TestEnvironment(); 308environment ??= new TestEnvironment();
Git\GitRepositoryTests.cs (3)
39var repo = new GitRepository(workspace.CreateExecutionContext(), new TestEnvironment(), logger, profilingTelemetry); 79var repository = new GitRepository(context, new TestEnvironment(), NullLogger<GitRepository>.Instance, profilingTelemetry); 249return new GitRepository(workspace.CreateExecutionContext(), new TestEnvironment(), loggerFactory.CreateLogger<GitRepository>(), profilingTelemetry);
Interaction\ConsoleInteractionServiceTests.cs (3)
244environment: new TestEnvironment(new Dictionary<string, string?> 285environment: new TestEnvironment(new Dictionary<string, string?> 320environment: new TestEnvironment(new Dictionary<string, string?>
Layout\LayoutDiscoveryReparsePointTests.cs (2)
246var discovery = new LayoutDiscovery(NullLogger<LayoutDiscovery>.Instance, new TestEnvironment()) 284var discovery = new LayoutDiscovery(NullLogger<LayoutDiscovery>.Instance, new TestEnvironment())
Layout\TrayLayoutTests.cs (1)
46var environment = new TestEnvironment(new Dictionary<string, string?>
Npm\NpmRunnerTests.cs (9)
35var startInfo = NpmRunner.CreateNpmProcessStartInfo("/usr/bin/npm", ["view", "express", "version"], "/tmp/workdir", new TestEnvironment(), stdin); 56@"C:\temp\workdir", new TestEnvironment(), stdin); 77@"C:\temp", new TestEnvironment(), stdin); 94@"C:\temp", new TestEnvironment(), stdin); 110"/tmp/workdir", new TestEnvironment(), stdin); 127"/tmp", new TestEnvironment(), stdin); 140var startInfo = NpmRunner.CreateNpmProcessStartInfo("/usr/bin/npm", [], "/tmp", new TestEnvironment(), stdin); 152var startInfo = NpmRunner.CreateNpmProcessStartInfo(@"C:\Program Files\nodejs\npm.cmd", [], @"C:\temp", new TestEnvironment(), stdin); 174var runner = new NpmRunner(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NpmRunner>.Instance, profilingTelemetry);
NuGet\NuGetClientTests.cs (28)
84var client = new NuGetClient(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance) 306new TestEnvironment(), 334new TestEnvironment(), 393var client = new NuGetClient(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance); 503var client = new NuGetClient(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), logger); 620new TestEnvironment(), 659new TestEnvironment(), 687new TestEnvironment(), 732new TestEnvironment(), 791new TestEnvironment(), 821new TestEnvironment(), 952var client = new NuGetClient(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance); 1039var client = new NuGetClient(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance); 1083new TestEnvironment(), 1189new TestEnvironment(), 1250new TestEnvironment(), 1299new TestEnvironment(), 1355new TestEnvironment(), 1412new TestEnvironment(), 1476new TestEnvironment(), 1540new TestEnvironment(), 1594new TestEnvironment(), 1651new TestEnvironment(), 1715new TestEnvironment(), 1775new TestEnvironment(), 1842new TestEnvironment(), 1863new TestEnvironment(), 1884new TestEnvironment(),
NuGet\NuGetConfigurationQueryTests.cs (1)
509new TestEnvironment(),
NuGet\NuGetPackageOperationConfigurationTests.cs (1)
233new TestEnvironment(),
NuGet\NuGetSignatureVerificationEnablerTests.cs (1)
15return new TestEnvironment(envVars);
Processes\ProcessTreeGracefulShutdownServiceTests.cs (1)
412executionContext, environment ?? new TestEnvironment(),
Projects\AppHostCandidateFinderTests.cs (3)
589return new AppHostCandidateFinder(gitRepository ?? new TestGitRepository(), new TestEnvironment(), profilingTelemetry ?? CreateProfilingTelemetry(), NullLogger<AppHostCandidateFinder>.Instance); 596var gitRepository = new GitRepository(executionContext, new TestEnvironment(), loggerFactory.CreateLogger<GitRepository>(), profilingTelemetry); 597return new AppHostCandidateFinder(gitRepository, new TestEnvironment(), profilingTelemetry, loggerFactory.CreateLogger<AppHostCandidateFinder>());
Projects\AppHostConfigurationProjectorTests.cs (5)
29var projector = new AppHostConfigurationProjector(configurationService, new TestEnvironment()); 48var projector = new AppHostConfigurationProjector(configurationService, new TestEnvironment()); 63var environment = new TestEnvironment(new Dictionary<string, string?> 88var projector = new AppHostConfigurationProjector(configurationService, new TestEnvironment()); 103var projector = new AppHostConfigurationProjector(configurationService, new TestEnvironment());
Projects\AppHostServerProjectTests.cs (7)
46return new DotNetBasedAppHostServerProject(appPath, socketPath, repoRoot, runner, packagingService, new TestProcessExecutionFactory(), new TestEnvironment(), logger); 67new TestEnvironment(), NullLogger<DotNetBasedAppHostServerProject>.Instance); 136new TestProcessExecutionFactory(), new TestEnvironment(), 546var project = new DotNetBasedAppHostServerProject(appPath, "test.sock", appPath, runner, packagingService, new TestProcessExecutionFactory(), new TestEnvironment(), logger, projectModelPath); 627new TestEnvironment(), 671new TestEnvironment(), 717new TestEnvironment(),
Projects\AppHostServerSessionTests.cs (3)
563return new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance) 640new TestEnvironment(), 664new TestEnvironment(),
Projects\DotNetAppHostProjectTests.cs (5)
647var environment = new TestEnvironment(new Dictionary<string, string?> 716? new TestEnvironment() 717: new TestEnvironment(environmentVariables.ToDictionary(pair => pair.Key, pair => (string?)pair.Value)); 1339var environment = new TestEnvironment(new Dictionary<string, string?> 1390var environment = new TestEnvironment(new Dictionary<string, string?>
Projects\DotNetBasedAppHostServerScaffoldCacheTests.cs (1)
213new TestEnvironment(),
Projects\GuestAppHostProjectTests.cs (1)
2686var effectiveEnvironment = environment ?? new TestEnvironment();
Projects\GuestRuntimeTests.cs (3)
31new TestEnvironment(), _loggerFactory.CreateLogger<ProcessExecutionFactory>())); 41new TestEnvironment(), 44new TestEnvironment(), _loggerFactory.CreateLogger<ProcessExecutionFactory>()),
Projects\NativeAppHostServerProjectTests.cs (3)
43var factory = CreateFactory(new TestEnvironment(new Dictionary<string, string?> 60var factory = CreateFactory(new TestEnvironment(), new NullBundleService(), new TestProcessExecutionFactory()); 102var factory = CreateFactory(new TestEnvironment(new Dictionary<string, string?>
Projects\PrebuiltAppHostServerTests.cs (7)
263new TestEnvironment(), 1514new TestEnvironment(), 2416new TestEnvironment(), 3297new TestEnvironment(), 4594new TestEnvironment(), 5054new TestEnvironment(), 5067new TestEnvironment(),
Projects\ProcessGuestLauncherTests.cs (1)
27new TestEnvironment(), _loggerFactory.CreateLogger<ProcessExecutionFactory>()));
Projects\ProjectLocatorTests.cs (5)
3149var projectLocator = CreateProjectLocator(executionContext, projectFactory: projectFactory, environment: new TestEnvironment(envVars)); 3217var projectLocator = CreateProjectLocator(executionContext, projectFactory: projectFactory, environment: new TestEnvironment(envVars)); 3257var projectLocator = CreateProjectLocator(executionContext, projectFactory: projectFactory, environment: new TestEnvironment(envVars)); 4424environment ?? new TestEnvironment(), 4431environment ?? new TestEnvironment(),
Projects\ProjectUpdaterNuGetConfigurationTests.cs (2)
604new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance); 706new ProcessExecutionFactory(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<ProcessExecutionFactory>.Instance);
Projects\TypeScriptAppHostToolchainResolverTests.cs (22)
20var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null); 31var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null); 46() => TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null)); 60var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(workspace.WorkspaceRoot, new TestEnvironment()); 73var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(workspace.WorkspaceRoot, new TestEnvironment()); 86var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(workspace.WorkspaceRoot, new TestEnvironment()); 99var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null); 111var exception = Assert.Throws<YarnClassicNotSupportedException>(() => TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null)); 122var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null); 135var exception = Assert.Throws<YarnClassicNotSupportedException>(() => TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null)); 151var exception = Assert.Throws<YarnClassicNotSupportedException>(() => TypeScriptAppHostToolchainResolver.Resolve(appHostDirectory, new TestEnvironment(), logger: null)); 167var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(appHostDirectory, new TestEnvironment()); 181var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(workspace.WorkspaceRoot, new TestEnvironment()); 194var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null); 205var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger: null); 220var toolchain = TypeScriptAppHostToolchainResolver.Resolve(workspace.WorkspaceRoot, new TestEnvironment(), logger); 237var toolchain = TypeScriptAppHostToolchainResolver.Resolve(appHostDirectory, new TestEnvironment(), logger: null); 251var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(appHostDirectory, new TestEnvironment()); 267var resolution = TypeScriptAppHostToolchainResolver.ResolveWithReason(appHostDirectory, new TestEnvironment()); 281var toolchain = TypeScriptAppHostToolchainResolver.Resolve(appHostDirectory, new TestEnvironment(), logger: null); 291var shouldSearch = TypeScriptAppHostToolchainResolver.ShouldSearchParentDirectory(directory, new TestEnvironment()); 303new TestEnvironment(),
Scaffolding\ChannelReseedTests.cs (2)
88environment: new TestEnvironment(), 127environment: new TestEnvironment(),
Scaffolding\DefaultHostingPackagesTests.cs (1)
201environment: new TestEnvironment(),
Scaffolding\ScaffoldingServiceTests.cs (1)
195new TestEnvironment(),
Telemetry\AspireCliTelemetryTests.cs (4)
816services.AddSingleton<IEnvironment>(new TestEnvironment(environmentVariables)); 829var environment = new TestEnvironment(environmentVariables.ToDictionary(variable => variable.Item1, variable => variable.Item2, StringComparer.Ordinal)); 841var environment = new TestEnvironment(new Dictionary<string, string?>(comparer) 854var detector = new CodingAgentDetector(new TestEnvironment(environmentVariables));
Telemetry\CIEnvironmentDetectorTests.cs (8)
16var environment = new TestEnvironment(); 59var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = value }); 85var environment = new TestEnvironment(new Dictionary<string, string?> 110var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = value }); 125var environment = new TestEnvironment(new Dictionary<string, string?> 144var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = "true" }); 160var environment = new TestEnvironment(new Dictionary<string, string?> { ["CI"] = environmentValue }); 176var environment = new TestEnvironment(new Dictionary<string, string?>(StringComparer.Ordinal)
Telemetry\InternalMicrosoftDetectorTests.cs (2)
918return new ProcessExecution(startInfo, NullLogger.Instance, options, new TestEnvironment(), new Aspire.Shared.TemporaryStorage()); 1722var effectiveEnvironment = environment ?? new TestEnvironment(environmentVariables);
TestServices\NuGetTestHelper.cs (1)
46=> new(new TestFeatures(), new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance)
TestServices\TestConfigSourceServices.cs (1)
34return new ConfigSourceService(context, environment ?? new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), detector ?? new TestConfigSourceDetector(),
Utils\CliDownloaderTests.cs (1)
22var downloader = new CliDownloader(new TestEnvironment(), new Aspire.Shared.TemporaryStorage(), NullLogger<CliDownloader>.Instance, new TestInteractionService(), packagingService);
Utils\ContainerRuntimeCheckTests.cs (3)
167var environment = new TestEnvironment(new Dictionary<string, string?> 193var check = new ContainerRuntimeCheck(NullLogger<ContainerRuntimeCheck>.Instance, new TestEnvironment()); 207var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = configuredRuntime });
Utils\DeprecatedWorkloadCheckTests.cs (1)
18var environment = new TestEnvironment();
Utils\EnvironmentVariableExtensionsTests.cs (1)
21var environment = new TestEnvironment(new Dictionary<string, string?>
Utils\FileSystemHelperTests.cs (15)
267var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 282var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 297var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 312var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 323var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 333var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 346var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 360var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 375var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 390var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 399var result = FileSystemHelper.ShortenPaths(Array.Empty<string>(), new TestEnvironment()); 414var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 430var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 447var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment()); 462var result = FileSystemHelper.ShortenPaths(paths, new TestEnvironment());
Utils\MissingJavaScriptToolWarningTests.cs (1)
54var message = MissingJavaScriptToolWarning.GetMessage(workspace.WorkspaceRoot, s_typeScriptLanguage, new TestEnvironment());
Utils\TestEnvironment.cs (4)
51=> new(variables) { ReportRuntimeIdentifier = "win-x64", ReportIsWindows = true, ReportIsLinux = false, ReportIsMacOS = false }; 54=> new(variables) { ReportRuntimeIdentifier = "linux-x64", ReportIsWindows = false, ReportIsLinux = true, ReportIsMacOS = false }; 57=> new() { ReportRuntimeIdentifier = "linux-musl-x64", ReportIsWindows = false, ReportIsLinux = true, ReportIsMacOS = false }; 60=> new(variables) { ReportRuntimeIdentifier = "osx-arm64", ReportIsWindows = false, ReportIsLinux = false, ReportIsMacOS = true };
238 references to TestEnvironment
Aspire.Cli.Tests (238)
Acquisition\IdentityResolverTests.cs (1)
561var environment = new TestEnvironment(environmentVariables);
Acquisition\InstallSourceDetectorTests.cs (23)
27var environment = TestEnvironment.CreateWindows(new Dictionary<string, string?> 49var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), TestEnvironment.CreateLinux()); 61var detector = CreateDetector(processPath, TestEnvironment.CreateLinux()); 70var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 87var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 111var detector = CreateDetector(processPath, TestEnvironment.CreateWindows(), registry); 125var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), TestEnvironment.CreateLinux(), registry); 138var detector = CreateDetector(Path.Combine(workspace.Path, "aspire.exe"), TestEnvironment.CreateWindows(), registry); 162var detector = CreateDetector(processPath, TestEnvironment.CreateLinux()); 179var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 204var environment = TestEnvironment.CreateMacOS(new Dictionary<string, string?> 219var environment = windows ? TestEnvironment.CreateWindows() : TestEnvironment.CreateLinux(); 238var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 254var detector = CreateDetector(processPath, TestEnvironment.CreateLinux()); 270var detector = CreateDetector(linkPath, TestEnvironment.CreateLinux());
Agents\AgentConfigurationTestContext.cs (2)
38Environment = TestEnvironment.CreateWindows(_variables); 49public TestEnvironment Environment { get; }
Agents\AgentTelemetryHookTests.cs (1)
63var environment = new TestEnvironment(new Dictionary<string, string?>
Agents\CopilotAgentEnvironmentScannerTests.cs (3)
21var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 79var environment = new TestEnvironment(new Dictionary<string, string?> { ["TERM_PROGRAM"] = "vscode" });
Agents\CopilotAppInstallationDetectorTests.cs (15)
22var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 43var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 63var environment = TestEnvironment.CreateWindows(new Dictionary<string, string?> 79Assert.Equal(appBundlePath, CreateDetector(TestEnvironment.CreateMacOS(), workspace).GetInstallationMarker()); 86var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 115CreateDetector(TestEnvironment.CreateLinux(), workspace).GetInstallationMarker()); 122var detector = CreateDetector(TestEnvironment.CreateLinux(), workspace); 141var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 167var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?>
Agents\TelemetryHookConfiguratorTests.cs (1)
423var environment = new TestEnvironment(environmentVariables);
Agents\TelemetryHookScriptTests.cs (1)
550var nativeEnvironment = new TestEnvironment(environment);
Agents\VsCodeAgentEnvironmentScannerTests.cs (1)
118var environment = new TestEnvironment(new Dictionary<string, string?> { ["TERM_PROGRAM"] = "vscode" });
Backchannel\AppHostCliBackchannelTests.cs (2)
21var environment = new TestEnvironment(new Dictionary<string, string?> 127var environment = new TestEnvironment(new Dictionary<string, string?>
Certificates\CertificateFactoryTests.cs (1)
99var manager = CertificateManager.Create(NullLogger.Instance, TestEnvironment.CreateLinux(), nssDbOverride: null, temporaryStorage: new Aspire.Shared.TemporaryStorage());
Certificates\CertificateServiceTests.cs (10)
90}, nonInteractive: false, environment: TestEnvironment.CreateLinux( 118}, nonInteractive: true, environment: TestEnvironment.CreateLinux( 206services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 361services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 402services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 446return new CertificateService(toolRunner, interactiveService, telemetry, hostEnvironment, TestEnvironment.CreateLinux(), executionContext, logger); 493services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 531services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 577services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows(envVars)); 611services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows());
Certificates\NativeCertificateToolRunnerTests.cs (1)
134TestEnvironment.CreateLinux(),
Certificates\UnixCertificateManagerTests.cs (18)
215var environment = TestEnvironment.CreateLinux(); 251var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 419var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 465var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 499var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 534var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 569var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 604var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 679var environment = TestEnvironment.CreateLinux(variables);
CliBootstrapTests.cs (3)
379var environment = new TestEnvironment(); 413var environment = new TestEnvironment(envVars); 435var environment = new TestEnvironment();
Commands\AgentInitClientSelectionTests.cs (16)
635var environment = new TestEnvironment(); 791var environment = new TestEnvironment(); 841var environment = new TestEnvironment(); 896var environment = new TestEnvironment(); 961var environment = new TestEnvironment(); 1013var environment = new TestEnvironment(); 1054var environment = new TestEnvironment(new Dictionary<string, string?> { [variable] = value }); 1074var environment = new TestEnvironment(new Dictionary<string, string?> 1117var environment = new TestEnvironment(new Dictionary<string, string?> { ["OPENCODE_CONFIG"] = path }); 1147var environment = new TestEnvironment(new Dictionary<string, string?> { ["OPENCODE_CONFIG"] = path }); 1176var environment = new TestEnvironment(); 1229var environment = new TestEnvironment(); 1262var environment = new TestEnvironment(); 1292var environment = new TestEnvironment(); 1331var environment = new TestEnvironment(); 1423var environment = new TestEnvironment();
Commands\CertificatesCommandTests.cs (1)
105return new CertificateService(toolRunner, interactionService, telemetry, hostEnvironment, TestEnvironment.CreateLinux(), executionContext, logger);
Commands\CompletionsCommandTests.cs (3)
50var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> { ["SHELL"] = shellPath }); 58Assert.Equal("pwsh", CompletionScripts.DetectShell(TestEnvironment.CreateWindows()));
Commands\TrayCommandTests.cs (10)
31services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinux()); 52services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinux()); 76services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinux()); 273"linux" => TestEnvironment.CreateLinux(), 274"linux-musl" => TestEnvironment.CreateLinuxMusl(), 275"macos" => TestEnvironment.CreateMacOS(), 276_ => TestEnvironment.CreateWindows() 290services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinuxMusl()); 627services.AddSingleton<IEnvironment>(TestEnvironment.CreateMacOS()); 633services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows());
Commands\VsCodeExtensionCheckTests.cs (12)
18var environment = new TestEnvironment(new Dictionary<string, string?>()); 34var environment = new TestEnvironment(new Dictionary<string, string?> 64var environment = new TestEnvironment(new Dictionary<string, string?> 93var environment = new TestEnvironment(new Dictionary<string, string?> 118var environment = new TestEnvironment(new Dictionary<string, string?> 139var environment = new TestEnvironment(new Dictionary<string, string?> 160var environment = new TestEnvironment(new Dictionary<string, string?>()); 174var environment = new TestEnvironment(new Dictionary<string, string?>()); 190var environment = new TestEnvironment(new Dictionary<string, string?> 209var environment = new TestEnvironment(new Dictionary<string, string?> 231var environment = new TestEnvironment(new Dictionary<string, string?> 252var environment = new TestEnvironment(new Dictionary<string, string?>
Commands\WslEnvironmentCheckTests.cs (9)
292var check = new WslEnvironmentCheck(TestEnvironment.CreateMacOS(), () => Wsl1Banner); 330var check = new WslEnvironmentCheck(TestEnvironment.CreateLinux(), () => procVersion); 340var check = new WslEnvironmentCheck(TestEnvironment.CreateLinux(), () => procVersion); 350var check = new WslEnvironmentCheck(TestEnvironment.CreateLinux(), () => procVersion); 372var check = new WslEnvironmentCheck(TestEnvironment.CreateLinux(), () => Wsl1Banner); 383var check = new WslEnvironmentCheck(TestEnvironment.CreateLinux(), () => HistoricalWsl1Banner); 541private static TestEnvironment CreateLinuxEnvironment(string? distroName, string? wslInterop = null) 545return TestEnvironment.CreateLinux(); 560return TestEnvironment.CreateLinux(environmentVariables);
Configuration\ConfigSourceServiceTests.cs (9)
34var environment = new TestEnvironment(new Dictionary<string, string?> 96var environment = new TestEnvironment(new Dictionary<string, string?> 124var environment = new TestEnvironment(new Dictionary<string, string?> 182var environment = new TestEnvironment(new Dictionary<string, string?> 914var environment = new TestEnvironment(new Dictionary<string, string?> 1032var environment = new TestEnvironment(new Dictionary<string, string?> 1284var environment = new TestEnvironment(new Dictionary<string, string?> 2001var environment = new TestEnvironment(new Dictionary<string, string?> 2032var environment = new TestEnvironment(new Dictionary<string, string?>
DotNetSdkInstallerTests.cs (1)
33var environment = new TestEnvironment();
Layout\TrayLayoutTests.cs (3)
46var environment = new TestEnvironment(new Dictionary<string, string?> 88await BundleService.ExtractPayloadAsync(payload, extracted, TestEnvironment.CreateLinux(), CancellationToken.None); 114await BundleService.ExtractPayloadAsync(payload, extracted, TestEnvironment.CreateWindows(), CancellationToken.None);
NuGet\NuGetClientTests.cs (3)
863var client = new NuGetClient(new TestFeatures(), TestEnvironment.CreateLinux(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance); 893var client = new NuGetClient(new TestFeatures(), TestEnvironment.CreateLinux(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance); 925var client = new NuGetClient(new TestFeatures(), TestEnvironment.CreateLinux(), new Aspire.Shared.TemporaryStorage(), NullLogger<NuGetClient>.Instance);
NuGet\NuGetSignatureVerificationEnablerTests.cs (10)
118using (NuGetSignatureVerificationEnabler.ApplyToCurrentProcess(new TestFeatures(), TestEnvironment.CreateLinux())) 133var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 154var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 175var environment = TestEnvironment.CreateLinux(); 195var environment = TestEnvironment.CreateLinux(); 218using (NuGetSignatureVerificationEnabler.ApplyToCurrentProcess(features, TestEnvironment.CreateLinux()))
Processes\ProcessTreeGracefulShutdownServiceTests.cs (1)
245environment: TestEnvironment.CreateWindows());
ProgramTests.cs (3)
67var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 110TestEnvironment.CreateWindows(),
Projects\AppHostConfigurationProjectorTests.cs (1)
63var environment = new TestEnvironment(new Dictionary<string, string?>
Projects\DotNetAppHostProjectTests.cs (4)
647var environment = new TestEnvironment(new Dictionary<string, string?> 715var inheritedEnvironment = useExplicitOverlay 1339var environment = new TestEnvironment(new Dictionary<string, string?> 1390var environment = new TestEnvironment(new Dictionary<string, string?>
Projects\GuestAppHostProjectTests.cs (4)
2797var project = CreateGuestAppHostProject(environment: TestEnvironment.CreateWindows()); 2828var project = CreateGuestAppHostProject(environment: TestEnvironment.CreateMacOS()); 2883var environment = TestEnvironment.CreateWindows(new Dictionary<string, string?>
Projects\NativeAppHostServerProjectTests.cs (1)
532private static AppHostServerProjectFactory CreateFactory(TestEnvironment environment, IBundleService bundle,
Projects\TypeScriptAppHostToolchainResolverTests.cs (3)
316TestEnvironment.CreateWindows(), 329TestEnvironment.CreateMacOS(), 342TestEnvironment.CreateLinux(),
Telemetry\AspireCliTelemetryTests.cs (2)
829var environment = new TestEnvironment(environmentVariables.ToDictionary(variable => variable.Item1, variable => variable.Item2, StringComparer.Ordinal)); 841var environment = new TestEnvironment(new Dictionary<string, string?>(comparer)
Telemetry\CIEnvironmentDetectorTests.cs (8)
16var environment = new TestEnvironment(); 59var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = value }); 85var environment = new TestEnvironment(new Dictionary<string, string?> 110var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = value }); 125var environment = new TestEnvironment(new Dictionary<string, string?> 144var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = "true" }); 160var environment = new TestEnvironment(new Dictionary<string, string?> { ["CI"] = environmentValue }); 176var environment = new TestEnvironment(new Dictionary<string, string?>(StringComparer.Ordinal)
Telemetry\InternalMicrosoftDetectorTests.cs (6)
1131var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 1162var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 1714TestEnvironment? environment = null, 1722var effectiveEnvironment = environment ?? new TestEnvironment(environmentVariables);
Utils\CliTestHelper.cs (1)
247services.AddSingleton<IEnvironment, TestEnvironment>();
Utils\ContainerRuntimeCheckTests.cs (5)
167var environment = new TestEnvironment(new Dictionary<string, string?> 207var environment = new TestEnvironment(new Dictionary<string, string?> { [variableName] = configuredRuntime }); 227var environment = os == "linux" ? TestEnvironment.CreateLinux(variables) : TestEnvironment.CreateMacOS(variables);
Utils\DcpConnectionHealthCheckTests.cs (1)
694TestEnvironment.CreateWindows(),
Utils\DeprecatedWorkloadCheckTests.cs (1)
18var environment = new TestEnvironment();
Utils\DevCertsCheckTests.cs (32)
361var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 396var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 442var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 486var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 537var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 592var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 642var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 701var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 758var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 799var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 843var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 889var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 935var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 981var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 1024var environment = TestEnvironment.CreateLinux(new Dictionary<string, string?> 1060var environment = TestEnvironment.CreateMacOS(new Dictionary<string, string?>
Utils\EnvironmentVariableExtensionsTests.cs (1)
21var environment = new TestEnvironment(new Dictionary<string, string?>
Utils\TestEnvironment.cs (4)
50public static TestEnvironment CreateWindows(IReadOnlyDictionary<string, string?>? variables = null) 53public static TestEnvironment CreateLinux(IReadOnlyDictionary<string, string?>? variables = null) 56public static TestEnvironment CreateLinuxMusl() 59public static TestEnvironment CreateMacOS(IReadOnlyDictionary<string, string?>? variables = null)