Implemented interface member:
property
Annotations
Aspire.Hosting.ApplicationModel.IResource.Annotations
20 overrides of Annotations
Aspire.Hosting (2)
ExecutableResourceBuilderExtensions.cs (1)
247public override ResourceAnnotationCollection Annotations => er.Annotations;
ProjectResourceBuilderExtensions.cs (1)
1311public override ResourceAnnotationCollection Annotations => pr.Annotations;
Aspire.Hosting.Azure.AppConfiguration (1)
AzureAppConfigurationEmulatorResource.cs (1)
17public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBEmulatorResource.cs (1)
18public override ResourceAnnotationCollection Annotations => InnerResource.Annotations;
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsEmulatorResource.cs (1)
27public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Functions (1)
DurableTask\DurableTaskSchedulerEmulatorResource.cs (1)
22public override ResourceAnnotationCollection Annotations => scheduler.Annotations;
Aspire.Hosting.Azure.Kusto (1)
AzureKustoEmulatorResource.cs (1)
24public override ResourceAnnotationCollection Annotations => InnerResource.Annotations;
Aspire.Hosting.Azure.PostgreSQL (3)
AzurePostgresFlexibleServerDatabaseResource.cs (1)
72public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
AzurePostgresFlexibleServerResource.cs (1)
69public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
AzurePostgresResource.cs (1)
34public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Redis (3)
AzureManagedRedisResource.cs (1)
78public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
AzureRedisCacheResource.cs (1)
59public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
AzureRedisResource.cs (1)
34public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusEmulatorResource.cs (1)
22public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.SignalR (1)
AzureSignalREmulatorResource.cs (1)
17public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Sql (2)
AzureSqlDatabaseResource.cs (1)
88public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
AzureSqlServerResource.cs (1)
158public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations;
Aspire.Hosting.Azure.Storage (1)
AzureStorageEmulatorResource.cs (1)
20public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubEmulatorResource.cs (1)
17public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Tests (1)
WithUrlsTests.cs (1)
1203public override ResourceAnnotationCollection Annotations { get; } = annotations ?? [];
1686 references to Annotations
Aspire.Hosting (44)
ApplicationModel\DotnetToolResource.cs (1)
31Annotations.Add(new DotnetToolAnnotation { PackageId = packageId });
ApplicationModel\ExecutableResource.cs (3)
28Annotations.Add(new ExecutableLaunchRecipeAnnotation(DirectExecutableLaunchRecipe.Instance)); 29Annotations.Add(new ExecutableAnnotation 46private ExecutableAnnotation GetAnnotation() => Annotations.OfType<ExecutableAnnotation>().LastOrDefault()
ApplicationModel\ProjectResource.cs (2)
23Annotations.Add(new ExecutableLaunchRecipeAnnotation(ProjectExecutableLaunchRecipe.Instance)); 29Annotations.Add(new ProjectLaunchDefaultsAnnotation());
ApplicationModel\Resource.cs (1)
37return $@"Type = {GetType().Name}, Name = ""{Name}"", Annotations = {Annotations.Count}";
ContainerResourceBuilderExtensions.cs (12)
360if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } existingImageAnnotation) 366if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation && 391if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } existingImageAnnotation) 432if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } imageAnnotation) 439builder.Resource.Annotations.Add(imageAnnotation); 460if (builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault() is { } buildAnnotation) 483if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } existingImageAnnotation) 717if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { }) 867if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { }) 1154var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault(); 1285var annotation = builder.Resource.Annotations.OfType<DockerfileBuildAnnotation>().SingleOrDefault(); 1718var callbackAnnotation = builder.Resource.Annotations.OfType<DockerfileBuilderCallbackAnnotation>().LastOrDefault();
Dashboard\DashboardEventHandlers.cs (2)
132dashboardResource.Annotations.Add(new CommandLineArgsCallbackAnnotation(args => 155dashboardResource.Annotations.Add(new CommandLineArgsCallbackAnnotation(args =>
ExecutableResourceBuilderExtensions.cs (4)
200var executableAnnotation = builder.Resource.Annotations.OfType<ExecutableAnnotation>().LastOrDefault(); 212builder.Resource.Annotations.Add(executableAnnotation); 231if (builder.Resource.Annotations.OfType<ExecutableAnnotation>().LastOrDefault() is { } executableAnnotation) 247public override ResourceAnnotationCollection Annotations => er.Annotations;
Lifecycle\DotnetBuildCommandEventingSubscriber.cs (3)
38lock (executable.Annotations) 47executable.Annotations.Add(new CommandLineArgsCallbackAnnotation(async context => 98executable.Annotations.Add(MultiThreadedBuildConfiguredAnnotation.Instance);
Lifecycle\TerminalHostEventingSubscriber.cs (2)
61if (host.Annotations.OfType<ExecutableAnnotation>().LastOrDefault() is not { } annotation) 95host.Annotations.Add(new CommandLineArgsCallbackAnnotation(args =>
Orchestrator\ParameterProcessor.cs (3)
206if (executionContext.IsRunMode && interactionService.IsAvailable && !parameterResource.Annotations.OfType<ResourceCommandAnnotation>().Any(a => a.Name.Equals(KnownResourceCommands.SetParameterCommand, StringComparisons.CommandName))) 371parameterResource.Annotations.Add(new ResourceCommandAnnotation( 407parameterResource.Annotations.Add(new ResourceCommandAnnotation(
ParameterResourceBuilderExtensions.cs (2)
277builder.Resource.Annotations.Add(new InputGeneratorAnnotation(createInput)); 294builder.Resource.Annotations.Add(new InputGeneratorAnnotation(parameter => new InteractionInput
ProjectResourceBuilderExtensions.cs (3)
1035builder.Resource.Annotations.Add(new EndpointEnvironmentInjectionFilterAnnotation(filter)); 1149rebuilder.Annotations.Add(NameValidationPolicyAnnotation.None); 1311public override ResourceAnnotationCollection Annotations => pr.Annotations;
Publishing\ManifestPublishingContext.cs (1)
333if (container.Annotations.OfType<DockerfileBuildAnnotation>().Any())
TerminalResourceBuilderExtensions.cs (5)
212terminalHost.Annotations.Add(new EnvironmentCallbackAnnotation(ctx => 351host.Annotations.Add(new ResourceSnapshotAnnotation(new CustomResourceSnapshot 360host.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 362host.Annotations.Add(new EnvironmentCallbackAnnotation(context => 373host.Annotations.Add(new CommandLineArgsCallbackAnnotation(context =>
Aspire.Hosting.Azure (10)
AzureBicepResource.cs (3)
36Annotations.Add(new ManifestPublishingCallbackAnnotation(WriteToManifest)); 39Annotations.Add(new PipelineStepAnnotation((factoryContext) => 58Annotations.Add(new PipelineConfigurationAnnotation(context =>
AzureEnvironmentResource.cs (2)
73Annotations.Add(new PipelineStepAnnotation((factoryContext) => 155Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore);
AzureResourcePreparer.cs (5)
40environmentResource.Annotations.Add(new HiddenAnnotation(HiddenBehavior.Always)); 547if (!azureResource.Annotations.OfType<RoleAssignmentResourceAnnotation>().Any(a => a.RolesResource == roleAssignmentResource)) 549azureResource.Annotations.Add(new RoleAssignmentResourceAnnotation(roleAssignmentResource)); 552if (!roleAssignmentResource.Annotations.OfType<ResourceRelationshipAnnotation>().Any(a => a.Resource == azureResource && a.Type == KnownRelationshipTypes.Parent)) 554roleAssignmentResource.Annotations.Add(new ResourceRelationshipAnnotation(azureResource, KnownRelationshipTypes.Parent));
Aspire.Hosting.Azure.AppConfiguration (1)
AzureAppConfigurationEmulatorResource.cs (1)
17public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.AppContainers (4)
AzureContainerAppEnvironmentResource.cs (2)
48Annotations.Add(new PipelineStepAnnotation(async (factoryContext) => 125Annotations.Add(new PipelineConfigurationAnnotation(context =>
AzureContainerAppResource.cs (2)
29Annotations.Add(new PipelineStepAnnotation((factoryContext) => 88Annotations.Add(new PipelineConfigurationAnnotation((context) =>
Aspire.Hosting.Azure.AppService (5)
AzureAppServiceEnvironmentResource.cs (3)
48Annotations.Add(new PipelineStepAnnotation(async (factoryContext) => 134Annotations.Add(new PipelineConfigurationAnnotation(context => 209Annotations.Add(new AzureAppServiceEnvironmentContextAnnotation(appServiceEnvironmentContext));
AzureAppServiceWebSiteResource.cs (2)
29Annotations.Add(new PipelineStepAnnotation((factoryContext) => 86Annotations.Add(new PipelineConfigurationAnnotation((context) =>
Aspire.Hosting.Azure.ConnectorNamespace (2)
AzureConnectorNamespaceExtensions.cs (2)
293connection.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 483config.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore);
Aspire.Hosting.Azure.ContainerRegistry (2)
AzureContainerRegistryResource.cs (2)
27Annotations.Add(new PipelineStepAnnotation((factoryContext) => 41Annotations.Add(new PipelineConfigurationAnnotation((context) =>
Aspire.Hosting.Azure.CosmosDB (3)
AzureCosmosDBEmulatorResource.cs (1)
18public override ResourceAnnotationCollection Annotations => InnerResource.Annotations;
AzureCosmosDBExtensions.cs (2)
607var roleAssignmentAnnotations = azureResource.Annotations.OfType<DefaultRoleAssignmentsAnnotation>().ToArray(); 610azureResource.Annotations.Remove(annotation);
Aspire.Hosting.Azure.EntraId (5)
EntraIdApplicationResource.cs (5)
56Annotations.Add(new TenantScopedResourceAnnotation(new Dictionary<string, string> 63Annotations.Add(new PipelineStepAnnotation(_ => new PipelineStep 82_provisioningAnnotations = [.. Annotations.Where(annotation => annotation is PipelineStepAnnotation or PipelineConfigurationAnnotation)]; 97Annotations.Add(new PipelineStepAnnotation(_ => new PipelineStep 156Annotations.Remove(annotation);
Aspire.Hosting.Azure.EntraId.Tests (22)
EntraIdApiProvisioningTests.cs (3)
873Assert.Empty(existing.Resource.Annotations.OfType<PipelineStepAnnotation>()); 874Assert.Empty(existingWithoutDeclarations.Resource.Annotations.OfType<PipelineStepAnnotation>()); 882var annotation = Assert.Single(resource.Annotations.OfType<PipelineStepAnnotation>(), IsApiAccessValidation);
EntraIdPolyglotTests.cs (1)
95Assert.Empty(entra.Resource.Annotations.OfType<PipelineStepAnnotation>());
EntraIdProvisioningTests.cs (16)
521var tenantScoped = Assert.Single(entra.Resource.Annotations.OfType<TenantScopedResourceAnnotation>()); 929foreach (var callback in web.Resource.Annotations.OfType<ResourceUrlsCallbackAnnotation>()) 991foreach (var callback in web.Resource.Annotations.OfType<ResourceUrlsCallbackAnnotation>()) 1022foreach (var callback in web.Resource.Annotations.OfType<ResourceUrlsCallbackAnnotation>()) 1045foreach (var callback in web.Resource.Annotations.OfType<ResourceUrlsCallbackAnnotation>()) 1135Assert.Empty(entra.Resource.Annotations.OfType<PipelineStepAnnotation>()); 1136Assert.Empty(entra.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 1148Assert.Empty(entra.Resource.Annotations.OfType<PipelineStepAnnotation>()); 1149Assert.Empty(entra.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 1170Assert.Empty(existing.Resource.Annotations.OfType<PipelineStepAnnotation>()); 1171Assert.Same(customization, Assert.Single(existing.Resource.Annotations.OfType<PipelineConfigurationAnnotation>())); 1241Assert.Empty(existing.Resource.Annotations.OfType<PipelineStepAnnotation>()); 1243Assert.Single(azure.Annotations.OfType<PipelineStepAnnotation>()); 1266Assert.Equal(2, created.Annotations.OfType<PipelineStepAnnotation>().Count()); 1280Assert.Same(customization, Assert.Single(entra.Resource.Annotations.OfType<PipelineConfigurationAnnotation>())); 1449var wait = Assert.Single(node.Resource.Annotations.OfType<WaitAnnotation>());
EntraIdResourceBuilderTests.cs (2)
292var annotation = Assert.Single(entra.Resource.Annotations.OfType<ResourceSnapshotAnnotation>()); 1126var relationships = project.Resource.Annotations
Aspire.Hosting.Azure.EventHubs (3)
AzureEventHubsEmulatorResource.cs (1)
27public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
AzureEventHubsExtensions.cs (2)
317var customConfigFile = builder.Resource.Annotations.OfType<ConfigFileAnnotation>().FirstOrDefault(); 338var configJsonAnnotations = builder.Resource.Annotations.OfType<ConfigJsonAnnotation>();
Aspire.Hosting.Azure.FrontDoor (5)
AzureFrontDoorExtensions.cs (4)
84var originAnnotations = azureResource.Annotations.OfType<AzureFrontDoorOriginAnnotation>().ToList(); 208if (builder.Resource.Annotations 291var connection = frontDoor.Annotations 325foreach (var connection in frontDoor.Annotations.OfType<AzureFrontDoorPrivateLinkAnnotation>())
AzureFrontDoorPrivateLinkExtensions.cs (1)
123if (frontDoor.Resource.Annotations
Aspire.Hosting.Azure.Functions (3)
DurableTask\DurableTaskResourceExtensions.cs (2)
36scheduler.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 226hub.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore);
DurableTask\DurableTaskSchedulerEmulatorResource.cs (1)
22public override ResourceAnnotationCollection Annotations => scheduler.Annotations;
Aspire.Hosting.Azure.Kubernetes (17)
AzureKubernetesEnvironmentExtensions.cs (10)
81resource.Annotations.Add(new KubernetesEnvironmentAnnotation()); 95resource.Annotations.Add(new ContainerRegistryReferenceAnnotation(defaultRegistry.Resource)); 510var staleAnnotations = builder.Resource.KubernetesEnvironment.Annotations 514builder.Resource.KubernetesEnvironment.Annotations.Remove(old); 517builder.Resource.KubernetesEnvironment.Annotations.Add( 605var existingDelegation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().LastOrDefault(); 1025resource.Annotations.Add(new PipelineStepAnnotation(async factoryContext => 1029foreach (var annotation in resource.KubernetesEnvironment.Annotations.OfType<PipelineStepAnnotation>()) 1044resource.Annotations.Add(new PipelineConfigurationAnnotation(async context => 1046foreach (var annotation in resource.KubernetesEnvironment.Annotations.OfType<PipelineConfigurationAnnotation>())
AzureKubernetesEnvironmentResource.AksPipeline.cs (4)
169defaultPool.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 170defaultPool.Annotations.Add(new ResourceIconAnnotation("Cpu")); 197pool.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 198pool.Annotations.Add(new ResourceIconAnnotation("Cpu"));
AzureKubernetesEnvironmentResource.cs (2)
44Annotations.Add(new PipelineStepAnnotation(_ => 88Annotations.Add(new PipelineConfigurationAnnotation(async context =>
AzureKubernetesLoadBalancerResource.cs (1)
81Annotations.Add(new PipelineStepAnnotation(_ =>
Aspire.Hosting.Azure.Kubernetes.Tests (18)
AzureKubernetesEnvironmentExtensionsTests.cs (7)
777Assert.Collection(aks.Resource.KubeletIdentity!.Annotations.OfType<RoleAssignmentAnnotation>(), 780Assert.Collection(aks.Resource.ControlPlaneIdentity!.Annotations.OfType<RoleAssignmentAnnotation>(), 985foreach (var annotation in aks.Resource.ControlPlaneIdentity!.Annotations.OfType<RoleAssignmentAnnotation>() 1259var delegation = Assert.Single(albSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 1280var delegation = Assert.Single(albSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 1301var delegation = Assert.Single(albSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 1324var delegation = Assert.Single(albSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>());
AzureKubernetesInfrastructureTests.cs (11)
496azureEnvironment.Annotations.Add(new PipelineConfigurationAnnotation(context => 579azureEnvironment.Annotations.Add(new PipelineConfigurationAnnotation(context => 927aks.Resource.KubernetesEnvironment.Annotations.Add( 929aks.Resource.KubernetesEnvironment.Annotations.Add( 999aks.Resource.KubernetesEnvironment.Annotations.Add( 1064aks.Resource.KubernetesEnvironment.Annotations.Add( 1066aks.Resource.KubernetesEnvironment.Annotations.Add( 1402foreach (var annotation in aks.Resource.Annotations.OfType<PipelineStepAnnotation>()) 1496foreach (var annotation in aks.Resource.Annotations.OfType<PipelineStepAnnotation>()) 1709foreach (var annotation in aks.Resource.Annotations.OfType<PipelineStepAnnotation>()) 1779foreach (var annotation in aks.Resource.Annotations.OfType<PipelineStepAnnotation>())
Aspire.Hosting.Azure.Kusto (3)
AzureKustoBuilderExtensions.cs (1)
288var hasCustomScript = databaseResource.Annotations.OfType<AzureKustoCreateDatabaseScriptAnnotation>().Any();
AzureKustoEmulatorResource.cs (1)
24public override ResourceAnnotationCollection Annotations => InnerResource.Annotations;
AzureKustoReadWriteDatabaseResourceExtensions.cs (1)
22var scriptAnnotation = databaseResource.Annotations.OfType<AzureKustoCreateDatabaseScriptAnnotation>().LastOrDefault();
Aspire.Hosting.Azure.Kusto.Tests (14)
AddAzureKustoTests.cs (14)
49var containerAnnotation = resourceBuilder.Resource.Annotations.OfType<ContainerImageAnnotation>().SingleOrDefault(); 69var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 89var emulatorAnnotation = resourceBuilder.Resource.Annotations.OfType<EmulatorResourceAnnotation>().SingleOrDefault(); 107var nameAnnotation = resourceBuilder.Resource.Annotations.OfType<ContainerNameAnnotation>().SingleOrDefault(); 111var argsAnnotation = resourceBuilder.Resource.Annotations.OfType<ContainerRuntimeArgsCallbackAnnotation>().SingleOrDefault(); 126var annotation = resourceBuilder.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().SingleOrDefault(); 217var volumeAnnotation = resourceBuilder.Resource.Annotations.OfType<ContainerMountAnnotation>().SingleOrDefault(); 240var mountAnnotation = resourceBuilder.Resource.Annotations.OfType<ContainerMountAnnotation>().SingleOrDefault(); 262var mountAnnotations = resourceBuilder.Resource.Annotations.OfType<ContainerMountAnnotation>().ToList(); 292var containerImageAnnotation = resourceBuilder.Resource.Annotations.OfType<ContainerImageAnnotation>().SingleOrDefault(); 312var persistenceAnnotation = Assert.Single(resourceBuilder.Resource.Annotations.OfType<PersistenceAnnotation>()); 327Assert.Single(kustoServer.Resource.Annotations, annotation => annotation is HealthCheckAnnotation hca && hca.Key == $"{name}_check"); 342Assert.Single(database.Resource.Annotations, annotation => annotation is HealthCheckAnnotation hca && hca.Key == $"{name}_check"); 359var endpointAnnotations = resourceBuilder.Resource.Annotations.OfType<EndpointAnnotation>().ToList();
Aspire.Hosting.Azure.Network (3)
AzureVirtualNetworkExtensions.cs (3)
329var existingDelegation = subnet.Resource.Annotations 400foreach (var existing in builder.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().ToArray()) 402builder.Resource.Annotations.Remove(existing);
Aspire.Hosting.Azure.PostgreSQL (9)
AzurePostgresExtensions.cs (2)
87if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().SingleOrDefault() is { } containerAnnotation) 89builder.Resource.Annotations.Remove(containerAnnotation);
AzurePostgresFlexibleServerDatabaseResource.cs (3)
72public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations; 85innerResource.Annotations.Add(annotation);
AzurePostgresFlexibleServerResource.cs (3)
69public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations; 220innerResource.Annotations.Add(annotation);
AzurePostgresResource.cs (1)
34public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Redis (9)
AzureManagedRedisResource.cs (3)
78public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations; 161innerResource.Annotations.Add(annotation);
AzureRedisCacheResource.cs (3)
59public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations; 99innerResource.Annotations.Add(annotation);
AzureRedisExtensions.cs (2)
70if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().SingleOrDefault() is { } containerAnnotation) 72builder.Resource.Annotations.Remove(containerAnnotation);
AzureRedisResource.cs (1)
34public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Sandboxes (8)
AzureSandboxCleanupResource.cs (3)
16Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 17Annotations.Add(new PipelineStepAnnotation(CreateSteps)); 18Annotations.Add(new PipelineConfigurationAnnotation(AzureSandboxContainerDeployment.ConfigureStaleCleanupDestroyOrdering));
AzureSandboxGroupResource.cs (5)
39Annotations.Add(new PipelineStepAnnotation(async factoryContext => 93Annotations.Add(new PipelineConfigurationAnnotation(async context => 270sandboxContainer.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 271sandboxContainer.Annotations.Add(new PipelineStepAnnotation(_ => AzureSandboxContainerDeployment.CreatePipelineSteps(sandboxContainer))); 272sandboxContainer.Annotations.Add(new PipelineConfigurationAnnotation(async context =>
Aspire.Hosting.Azure.ServiceBus (5)
AzureServiceBusEmulatorResource.cs (1)
22public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
AzureServiceBusExtensions.cs (4)
462foreach (var sqlServerConfiguration in builder.Resource.Annotations.OfType<SqlServerConfigurationAnnotation>()) 467if (!sqlServerBuilder.Resource.Annotations.OfType<EndpointAnnotation>().Any(e => e.Name == SqlServerEndpointName)) 503var customConfigFile = builder.Resource.Annotations.OfType<ConfigFileAnnotation>().FirstOrDefault(); 524var configJsonAnnotations = builder.Resource.Annotations.OfType<ConfigJsonAnnotation>();
Aspire.Hosting.Azure.SignalR (1)
AzureSignalREmulatorResource.cs (1)
17public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Sql (8)
AzureSqlDatabaseResource.cs (3)
88public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations; 101innerResource.Annotations.Add(annotation);
AzureSqlExtensions.cs (2)
46if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().SingleOrDefault() is { } containerAnnotation) 48builder.Resource.Annotations.Remove(containerAnnotation);
AzureSqlServerResource.cs (3)
158public override ResourceAnnotationCollection Annotations => InnerResource?.Annotations ?? base.Annotations; 183innerResource.Annotations.Add(annotation);
Aspire.Hosting.Azure.Storage (1)
AzureStorageEmulatorResource.cs (1)
20public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Azure.Tests (262)
AzureAppConfigurationExtensionsTests.cs (1)
140appConfiguration.Resource.Annotations,
AzureAppServiceTests.cs (1)
1480foreach (var annotation in resource.Annotations.OfType<PipelineStepAnnotation>())
AzureBicepResourceTests.cs (1)
221var annotation = bicepResource.Resource.Annotations.OfType<Aspire.Hosting.Pipelines.PipelineStepAnnotation>().FirstOrDefault();
AzureConnectorNamespaceTests.cs (2)
187Assert.Single(connection.Resource.Annotations.OfType<ManifestPublishingCallbackAnnotation>())); 190Assert.Single(mcp.Resource.Annotations.OfType<ManifestPublishingCallbackAnnotation>()));
AzureContainerAppExpressEndpointTests.cs (2)
96Assert.Single(api.Resource.Annotations.OfType<DeploymentTargetAnnotation>()); 376foreach (var annotation in environment.Resource.Annotations.OfType<PipelineStepAnnotation>())
AzureContainerAppsTests.cs (3)
2808var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 2935var configAnnotations = containerAppResource.Annotations.OfType<PipelineConfigurationAnnotation>().ToList(); 3339foreach (var annotation in resource.Annotations.OfType<PipelineStepAnnotation>())
AzureContainerRegistryTests.cs (4)
143var pipelineStepAnnotations = acr.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 173var pipelineStepAnnotations = acr.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 202var pipelineStepAnnotations = acr.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 228var configAnnotations = acr.Resource.Annotations.OfType<PipelineConfigurationAnnotation>().ToList();
AzureCosmosDBExtensionsTests.cs (33)
38var endpointAnnotation = cosmos.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(); 59var containerImageAnnotation = cosmos.Resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault(); 557Assert.Contains(cosmos.Resource.Annotations, a => a is EmulatorResourceAnnotation); 569Assert.Contains(cosmos.Resource.Annotations, a => a is EmulatorResourceAnnotation); 579Assert.NotEmpty(cosmos.Resource.Annotations.OfType<OtlpExporterAnnotation>()); 665Assert.Contains(cosmos.Resource.Annotations, a => a is HttpsCertificateConfigurationCallbackAnnotation); 676Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is HttpsCertificateConfigurationCallbackAnnotation); 687cosmos.Resource.Annotations.OfType<HttpsCertificateConfigurationCallbackAnnotation>()); 722cosmos.Resource.Annotations.OfType<CertificateTrustConfigurationCallbackAnnotation>()); 754cosmos.Resource.Annotations.OfType<HttpsCertificateConfigurationCallbackAnnotation>()); 809var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 841var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 870var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 900var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 911var image = Assert.Single(cosmos.Resource.Annotations.OfType<ContainerImageAnnotation>()); 926var image = Assert.Single(cosmos.Resource.Annotations.OfType<ContainerImageAnnotation>()); 939var image = Assert.Single(cosmos.Resource.Annotations.OfType<ContainerImageAnnotation>()); 953var mount = Assert.Single(cosmos.Resource.Annotations.OfType<ContainerMountAnnotation>()); 973var mount = Assert.Single(cosmos.Resource.Annotations.OfType<ContainerMountAnnotation>()); 1013var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1073var healthEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulatorhealth"); 1078Assert.Contains(cosmos.Resource.Annotations, a => a is HealthCheckAnnotation); 1088Assert.Contains(cosmos.Resource.Annotations, a => a is HealthCheckAnnotation hc && hc.Key == "cosmos_check"); 1099var mount = Assert.Single(cosmos.Resource.Annotations.OfType<ContainerMountAnnotation>()); 1124var endpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 1202Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is ContainerImageAnnotation); 1203Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is EmulatorResourceAnnotation); 1204Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is ContainerMountAnnotation); 1215Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is ContainerImageAnnotation); 1216Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is EmulatorResourceAnnotation); 1217Assert.DoesNotContain(cosmos.Resource.Annotations, a => a is ContainerMountAnnotation); 1255foreach (var callback in cosmos.Resource.Annotations.OfType<ResourceUrlsCallbackAnnotation>()) 1280foreach (var callback in cosmos.Resource.Annotations.OfType<ResourceUrlsCallbackAnnotation>())
AzureDeployerTests.cs (1)
360var dockerFileAnnotation = c.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AzureEnvironmentResourceExtensionsTests.cs (81)
104var delete = Assert.Single(environment.Annotations.OfType<ResourceCommandAnnotation>(), 166}.Order(), directory.Resource.Annotations.OfType<ResourceCommandAnnotation>().Select(command => command.Name).Order()); 168var delete = Assert.Single(environment.Annotations.OfType<ResourceCommandAnnotation>(), 215arm.Resource.Annotations.OfType<ResourceCommandAnnotation>().Select(command => command.Name).Order()); 272var command = Assert.Single(environment.Annotations.OfType<ResourceCommandAnnotation>(), 300var command = Assert.Single(environment.Annotations.OfType<ResourceCommandAnnotation>(), 370var resetCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ResetProvisioningStateCommandName); 384var commands = environmentResource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 417var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 481var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 538var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 582var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 650var resetCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ResetProvisioningStateCommandName); 704var resetCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ResetProvisioningStateCommandName); 975Assert.Contains(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ForgetStateCommandName); 976var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 993Assert.Contains(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 994var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 995var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 996var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 1000Assert.DoesNotContain(blobs.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => 1145var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1229var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1498var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1562var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1623var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1684var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 1819var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 1877var command = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == commandName); 1929var queuedReprovisionCommand = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 1941var conflictingCommand = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2024var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2108var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2202var deleteCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2273var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2350var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2351var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2430var forgetCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ForgetStateCommandName); 2494var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2548var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2608var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2684var reprovisionStorageCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2685var reprovisionStorage2Command = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2761var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2762var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2860var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2906var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2958var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2959var cancelCommand = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 3026var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3099var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3152var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3198visibleResource.Annotations.Add(new AzureBicepResourceAnnotation(bicepResource)); 3212var changeLocationCommand = Assert.Single(visibleResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3267var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3344var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3404var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3473var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3530var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3593var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3665var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3719var reprovisionAllCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionAllCommandName); 3759var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3833var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3881var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3937var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 4084var reprovisionCommand = Assert.Single(storage2.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4163var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4235var reprovisionCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4315var reprovisionCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4441var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 4487var changeLocationCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 4533var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4599var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4840var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4892var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4939var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4987var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 5126var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 5215var icon = Assert.Single(resourceBuilder.Resource.Annotations.OfType<ResourceIconAnnotation>()); 5522var annotation = Assert.Single(environmentResource.Annotations.OfType<PipelineStepAnnotation>());
AzureEventHubsExtensionsTests.cs (12)
168var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 187var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 206var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 225var volumeAnnotation = eventHubs.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(a => !a.Target.Contains("Config.json")); 244var endpoints = eventHubs.Resource.Annotations.OfType<EndpointAnnotation>().ToList(); 272var containerImageAnnotation = eventHubs.Resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault(); 350var configAnnotation = eventHubsEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 407var configAnnotation = eventHubsEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 477var configAnnotation = eventHubsEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 517Assert.Same(eventHubs.Resource.Annotations, sourceResource.Annotations); 519var persistenceAnnotation = Assert.Single(eventHubs.Resource.Annotations.OfType<PersistenceAnnotation>()); 640Assert.Contains(eventHubs.Resource.Annotations, a => a is EmulatorResourceAnnotation);
AzureFrontDoorPrivateLinkTests.cs (6)
362Assert.Single(frontDoor.Resource.Annotations.OfType<AzureFrontDoorPrivateLinkAnnotation>()); 363Assert.Single(environment.Resource.Annotations.OfType<PrivateEndpointTargetAnnotation>()); 377Assert.Empty(environment.Resource.Annotations.OfType<PrivateEndpointTargetAnnotation>()); 378Assert.Empty(frontDoor.Resource.Annotations.OfType<AzureFrontDoorPrivateLinkAnnotation>()); 402var connection = Assert.Single(frontDoor.Resource.Annotations.OfType<AzureFrontDoorPrivateLinkAnnotation>()); 486Assert.Single(target.Resource.Annotations.OfType<PrivateEndpointTargetAnnotation>());
AzureFrontDoorTests.cs (2)
38var annotations = frontDoor.Resource.Annotations.OfType<AzureFrontDoorOriginAnnotation>().ToList(); 56var annotations = frontDoor.Resource.Annotations.OfType<AzureFrontDoorOriginAnnotation>().ToList();
AzureFunctionsTests.cs (9)
469Assert.DoesNotContain(functionsResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "debug"); 494Assert.Single(container.Annotations.OfType<AzureFunctionsAnnotation>()); 496var endpoint = Assert.Single(funcApp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 515var dockerBuildAnnotation = funcApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 555var dockerBuildAnnotation = funcApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 576var dockerBuildAnnotation = funcApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 610var commands = funcApp.Resource.Annotations.OfType<RequiredCommandAnnotation>().Select(a => a.Command).ToArray(); 624var commands = funcApp.Resource.Annotations.OfType<RequiredCommandAnnotation>().Select(a => a.Command).ToArray(); 1124var annotation = funcApp.Resource.Annotations.OfType<RequiredCommandAnnotation>().SingleOrDefault();
AzureKeyVaultTests.cs (5)
408keyVault.Resource.Annotations.Add(new ContainerImageAnnotation 424keyVault.Resource.Annotations.Add(new ContainerImageAnnotation 463keyVault.Resource.Annotations.Add(new ConnectionStringRedirectAnnotation(redirectTarget)); 484keyVault.Resource.Annotations.Add(new ContainerImageAnnotation 493keyVault.Resource.Annotations.Add(new ConnectionStringRedirectAnnotation(redirectTarget));
AzureManagedRedisExtensionsTests.cs (1)
87var endpoint = Assert.Single(redisResource.Annotations.OfType<EndpointAnnotation>());
AzurePostgresExtensionsTests.cs (2)
182var endpoint = Assert.Single(innerPostgres.Resource.Annotations.OfType<EndpointAnnotation>()); 390var mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<McpServerEndpointAnnotation>());
AzurePrivateEndpointExtensionsTests.cs (3)
42Assert.Empty(storage.Resource.Annotations.OfType<PrivateEndpointTargetAnnotation>()); 47var annotation = storage.Resource.Annotations.OfType<PrivateEndpointTargetAnnotation>().SingleOrDefault(); 63var annotation = storage.Resource.Annotations.OfType<PrivateEndpointTargetAnnotation>().SingleOrDefault();
AzureRedisExtensionsTests.cs (1)
131var endpoint = Assert.Single(redisResource.Annotations.OfType<EndpointAnnotation>());
AzureResourcePreparerTests.cs (14)
123Assert.Empty(role.Annotations.OfType<DeploymentPrerequisitesAnnotation>()); 125Assert.Same(roles[0], Assert.Single(first.Resource.Annotations.OfType<DeploymentPrerequisitesAnnotation>()).Resources.Single()); 126Assert.Same(roles[1], Assert.Single(second.Resource.Annotations.OfType<DeploymentPrerequisitesAnnotation>()).Resources.Single()); 498Assert.Single(storage.Resource.Annotations.OfType<RoleAssignmentResourceAnnotation>()); 499Assert.Single(storageRoles.Annotations.OfType<ResourceRelationshipAnnotation>()); 669agent.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation( 694agent.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation( 719agent.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation( 748agent1.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation(storage.Resource, role)); 751agent2.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation(storage.Resource, role)); 782agent.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation( 798var roleIds = consumer.Resource.Annotations.OfType<RoleAssignmentAnnotation>() 825agent.Resource.Annotations.Add(new ReferenceRoleAssignmentAnnotation( 839var roleIds = consumer.Resource.Annotations.OfType<RoleAssignmentAnnotation>()
AzureRunAsEmulatorModeTests.cs (2)
69var hidden = Assert.Single(environment.Annotations.OfType<HiddenAnnotation>()); 87Assert.Empty(environment.Annotations.OfType<HiddenAnnotation>());
AzureSandboxesTests.cs (12)
345var annotation = Assert.Single(sandboxGroup.Resource.Annotations.OfType<AzureSandboxGroupAcrPullIdentityAnnotation>()); 425var annotation = Assert.Single(sandboxGroup.Resource.Annotations.OfType<AzureSandboxGroupAcrPullIdentityAnnotation>()); 470var buildOptionsCallbackCount = container.Resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>().Count(); 486Assert.Equal(buildOptionsCallbackCount, container.Resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>().Count()); 2362var frontendCallbackCount = frontend.Resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>().Count(); 2363var backendCallbackCount = backend.Resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>().Count(); 2428var pipelineAnnotation = Assert.Single(sandboxContainer.Annotations.OfType<PipelineStepAnnotation>()); 2458foreach (var annotation in sandboxContainer.Annotations.OfType<PipelineConfigurationAnnotation>()) 2505foreach (var annotation in sandboxGroup.Resource.Annotations.OfType<PipelineConfigurationAnnotation>() 3088foreach (var annotation in sandboxGroup.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()) 3127foreach (var annotation in consumerGroup.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()) 3174foreach (var annotation in sandboxGroup.Resource.Annotations.OfType<PipelineConfigurationAnnotation>())
AzureServiceBusExtensionsTests.cs (15)
168serviceBus.Resource.Annotations.OfType<EndpointAnnotation>(), 191var containerImageAnnotation = serviceBus.Resource.Annotations.OfType<ContainerImageAnnotation>().FirstOrDefault(); 368var configAnnotation = serviceBusEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 463var configAnnotation = serviceBusEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 515var configAnnotation = serviceBusEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 571var configAnnotation = serviceBusEmulatorResource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 612Assert.Same(serviceBus.Resource.Annotations, sourceResource.Annotations); 614var persistenceAnnotation = Assert.Single(serviceBus.Resource.Annotations.OfType<PersistenceAnnotation>()); 808var endpoint = sql.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "tcp"); 809sql.Resource.Annotations.Remove(endpoint); 854serviceBus.Resource.Annotations.OfType<ResourceRelationshipAnnotation>(), 871var waits = serviceBus.Resource.Annotations.OfType<WaitAnnotation>().ToArray(); 960serviceBusSql.Annotations.Add(new ContainerNameAnnotation { Name = "my-servicebus-mssql-container" }); 962var nameAnnotation = Assert.Single(serviceBusSql.Annotations.OfType<ContainerNameAnnotation>()); 1255Assert.Contains(serviceBus.Resource.Annotations, a => a is EmulatorResourceAnnotation);
AzureSignalRExtensionsTests.cs (1)
66Assert.Contains(signalR.Resource.Annotations, a => a is EmulatorResourceAnnotation);
AzureSqlDeploymentScriptTests.cs (1)
202var delegation = Assert.Single(aciSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>());
AzureSqlExtensionsTests.cs (1)
149var endpoint = Assert.Single(innerSql.Resource.Annotations.OfType<EndpointAnnotation>());
AzureStorageExtensionsTests.cs (6)
36var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 62var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 88var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 114var volumeAnnotation = storage.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 133storage.Resource.Annotations.OfType<EndpointAnnotation>(), 1020Assert.Contains(storage.Resource.Annotations, a => a is EmulatorResourceAnnotation);
AzureUserAssignedIdentityTests.cs (2)
114var annotation = Assert.Single(project.Resource.Annotations.OfType<AppIdentityAnnotation>()); 133var annotation = Assert.Single(project.Resource.Annotations.OfType<AppIdentityAnnotation>());
AzureVirtualNetworkExtensionsTests.cs (20)
152var subnetAnnotation = env.Resource.Annotations.OfType<DelegatedSubnetAnnotation>().SingleOrDefault(); 157var delegationAnnotation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().SingleOrDefault(); 171var delegationAnnotation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().SingleOrDefault(); 186var delegationAnnotation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().SingleOrDefault(); 201var delegationAnnotation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().SingleOrDefault(); 226var delegationAnnotation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().Single(); 245var delegationAnnotation = Assert.Single(subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 283var subnetAnnotation = environment.Resource.Annotations.OfType<DelegatedSubnetAnnotation>().SingleOrDefault(); 287var delegationAnnotation = subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>().SingleOrDefault(); 304var subnetAnnotation = Assert.Single(environment.Resource.Annotations.OfType<DelegatedSubnetAnnotation>()); 307var delegationAnnotation = Assert.Single(subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 323Assert.Single(environment.Resource.Annotations.OfType<DelegatedSubnetAnnotation>()); 324var delegationAnnotation = Assert.Single(subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 341Assert.Single(environment.Resource.Annotations.OfType<DelegatedSubnetAnnotation>()); 342var delegationAnnotation = Assert.Single(subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 364Assert.Single(environment.Resource.Annotations.OfType<DelegatedSubnetAnnotation>()); 365Assert.Single(firstSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 366Assert.Empty(secondSubnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>()); 386Assert.Empty(appServiceEnvironment.Resource.Annotations.OfType<DelegatedSubnetAnnotation>()); 388var delegation = Assert.Single(subnet.Resource.Annotations.OfType<AzureSubnetServiceDelegationAnnotation>());
AzureWebPubSubEmulatorTests.cs (5)
39var image = Assert.Single(webPubSub.Resource.Annotations.OfType<ContainerImageAnnotation>()); 117Assert.Empty(webPubSub.Resource.Annotations.OfType<HealthCheckAnnotation>()); 128var healthCheckKey = Assert.Single(webPubSub.Resource.Annotations.OfType<HealthCheckAnnotation>()).Key; 142var healthCheckKey = Assert.Single(webPubSub.Resource.Annotations.OfType<HealthCheckAnnotation>()).Key; 169var annotation = Assert.Single(resource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>());
DurableTaskResourceExtensionsTests.cs (4)
143Assert.DoesNotContain(dts.Resource.Annotations, a => a is EmulatorResourceAnnotation); 158var emulatorAnnotation = dts.Resource.Annotations.OfType<EmulatorResourceAnnotation>().SingleOrDefault(); 161var containerImageAnnotation = dts.Resource.Annotations.OfType<ContainerImageAnnotation>().SingleOrDefault(); 167var endpointAnnotations = dts.Resource.Annotations.OfType<EndpointAnnotation>().ToList();
ProvisioningContextProviderTests.cs (6)
32resource.Annotations.Add(new TenantScopedResourceAnnotation(new Dictionary<string, string>())); 71resource.Annotations.Add(new TenantScopedResourceAnnotation(new Dictionary<string, string>())); 75resource.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore); 93resource.Annotations.Add(new TenantScopedResourceAnnotation(new Dictionary<string, string>())); 138resource.Annotations.Add(new TenantScopedResourceAnnotation(new Dictionary<string, string>())); 142resource.Annotations.Add(ManifestPublishingCallbackAnnotation.Ignore);
RoleAssignmentTests.cs (3)
243Assert.DoesNotContain(keyVaultResource.Annotations, a => a is DefaultRoleAssignmentsAnnotation); 272Assert.DoesNotContain(keyVaultResource.Annotations, a => a is DefaultRoleAssignmentsAnnotation); 275Assert.DoesNotContain(sbResource.Annotations, a => a is DefaultRoleAssignmentsAnnotation);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubEmulatorResource.cs (1)
17public override ResourceAnnotationCollection Annotations => _innerResource.Annotations;
Aspire.Hosting.Blazor (2)
BlazorGatewayExtensions.cs (1)
172var executableAnnotation = executableResource.Annotations.OfType<ExecutableAnnotation>().Last();
BrowserDebuggerHelper.cs (1)
74debuggerResource.Annotations.Add(NameValidationPolicyAnnotation.None);
Aspire.Hosting.Blazor.Tests (50)
AddBlazorGatewayTests.cs (16)
39var executable = Assert.Single(gateway.Resource.Annotations.OfType<ExecutableAnnotation>()); 42Assert.Single(gateway.Resource.Annotations.OfType<ProjectLaunchArgsOverrideAnnotation>()); 44var initialSnapshot = Assert.Single(gateway.Resource.Annotations.OfType<ResourceSnapshotAnnotation>()).InitialSnapshot; 51gateway.Resource.Annotations.OfType<EndpointAnnotation>().OrderBy(endpoint => endpoint.Name), 100var build = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 114Assert.Empty(gateway.Resource.Annotations.OfType<ProjectLaunchArgsOverrideAnnotation>()); 115Assert.Empty(gateway.Resource.Annotations.OfType<ExecutableAnnotation>()); 218var backendEndpoint = backend.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 224gateway.Resource.Annotations.Remove(gateway.Resource.Annotations.OfType<EndpointAnnotation>().Single(endpoint => endpoint.Name == "https")); 227var companion = Assert.Single(gateway.Resource.Annotations.OfType<ContainerFilesDestinationAnnotation>()).Source; 228var gatewayBuild = Assert.Single(gatewayContainer.Annotations.OfType<DockerfileBuildAnnotation>()); 233gatewayContainer.Annotations.Remove(gatewayBuild); 234gatewayContainer.Annotations.Add(new DockerfileBuildAnnotation(gatewayDirectory, Path.Combine(gatewayDirectory, "Dockerfile"), stage: null) 272var endpoint = gateway.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 501gateway.Resource.Annotations.OfType<EndpointReferenceAnnotation>(),
AddBlazorWasmAppTests.cs (1)
31var snapshot = resource.Annotations.OfType<ResourceSnapshotAnnotation>().FirstOrDefault();
AddDotnetProjectBlazorGatewayTests.cs (3)
29gateway.Resource.Annotations.OfType<EndpointAnnotation>().Select(e => e.Name)); 31var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().SingleOrDefault(); 54var gatewayRefs = gateway.Resource.Annotations
BlazorHostedExtensionsTests.cs (8)
186debuggerResource.Annotations.OfType<ResourceRelationshipAnnotation>(), 190var commands = host.Resource.Annotations 226host.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 263host.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 296host.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 394var endpointRef = host.Resource.Annotations 445var weatherRefs = host.Resource.Annotations 467var referencedNames = host.Resource.Annotations
GatewayConfigurationBuilderTests.cs (1)
589resource.Annotations.Add(annotation);
WithBlazorAppTests.cs (21)
29var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().SingleOrDefault(); 51var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().SingleOrDefault(); 75var annotations = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().ToList(); 98var gatewayRefs = gateway.Resource.Annotations 125var weatherRefs = gateway.Resource.Annotations 153var refs = gateway.Resource.Annotations 174var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().SingleOrDefault(); 201debuggerResource.Annotations.OfType<ResourceRelationshipAnnotation>(), 209var commandNames = wasmApp.Resource.Annotations 215Assert.DoesNotContain(gateway.Resource.Annotations, annotation => annotation is ResourceCommandAnnotation); 232Assert.DoesNotContain(wasmApp.Resource.Annotations, annotation => annotation is ResourceCommandAnnotation); 233Assert.Single(gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>()); 250var commands = wasmApp.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToDictionary(annotation => annotation.Name); 290wasmApp.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 317wasmApp.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 373var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().SingleOrDefault(); 398var endpointRef = gateway.Resource.Annotations 427var endpointRef = gateway.Resource.Annotations 438var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().Single(); 468var endpointRef = gateway.Resource.Annotations 479var annotation = gateway.Resource.Annotations.OfType<GatewayAppsAnnotation>().Single();
Aspire.Hosting.Browsers (1)
BrowserLogsBuilderExtensions.cs (1)
138browserLogsResource.Annotations.Add(NameValidationPolicyAnnotation.None);
Aspire.Hosting.Browsers.Tests (11)
BrowserLogsBuilderExtensionsTests.cs (10)
51Assert.Contains(browserLogsResource.Annotations.OfType<NameValidationPolicyAnnotation>(), static annotation => annotation == NameValidationPolicyAnnotation.None); 57var command = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.OpenTrackedBrowserCommandName); 60var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 63var screenshotCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.CaptureScreenshotCommandName); 67var snapshot = browserLogsResource.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot; 99var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 154var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 190var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 227var snapshot = browserLogsResource.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot; 353var snapshot = browserLogsResource.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot;
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (1)
138browserLogsResource.Annotations.Add(NameValidationPolicyAnnotation.None);
Aspire.Hosting.Containers.Tests (28)
ContainerResourceBuilderTests.cs (16)
16Assert.Equal("redis-stack", redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Image); 24Assert.Equal("redis-stack", redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Image); 25Assert.Equal("1.0.0", redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Tag); 33container.Resource.Annotations.RemoveAt(0); 36Assert.Equal("new-image", container.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Image); 37Assert.Equal("latest", container.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Tag); 45container.Resource.Annotations.Add(new ContainerImageAnnotation { Image = "another-image" }); 48Assert.Equal("new-image", container.Resource.Annotations.OfType<ContainerImageAnnotation>().Last().Image); 49Assert.Equal("latest", container.Resource.Annotations.OfType<ContainerImageAnnotation>().Last().Tag); 57Assert.Equal("7.1", redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Tag); 65Assert.Equal("myregistry.azurecr.io", redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().Registry); 73Assert.Equal("42b5c726e719639fcc1e9dbc13dd843f567dcd37911d0e1abb9f47f2cc1c95cd", redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single().SHA256); 151var annotation = redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single(); 163var annotation = redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single(); 176var annotation = redis.Resource.Annotations.OfType<ContainerImageAnnotation>().Single(); 212var annotation = redis.Resource.Annotations.OfType<ContainerImagePullPolicyAnnotation>().Single();
WithDockerfileTests.cs (12)
654var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 670var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 687var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 703var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 720var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 736var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 753var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 769var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 794var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 798var stepsAnnotation = Assert.Single(container.Resource.Annotations.OfType<PipelineStepAnnotation>()); 846var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 899var annotation = Assert.Single(container.Resource.Annotations.OfType<DockerfileBuildAnnotation>());
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
619portResource.Annotations.Add(portResource.TunnelEndpointAnnotation);
Aspire.Hosting.DevTunnels.Tests (8)
DevTunnelResourceBuilderExtensionsTests.cs (8)
75var annotation = Assert.Single(tunnel.Resource.Annotations.OfType<PersistenceAnnotation>()); 86Assert.Empty(tunnel.Resource.Annotations.OfType<PersistenceAnnotation>()); 569var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 659var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 709var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 784foreach (var annotation in tunnel.Resource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().ToArray()) 786tunnel.Resource.Annotations.Remove(annotation); 856Assert.Single(tunnelPort.Annotations.OfType<HealthCheckAnnotation>());
Aspire.Hosting.Docker (4)
DockerComposeEnvironmentResource.cs (3)
60Annotations.Add(new PipelineStepAnnotation(async (factoryContext) => 207Annotations.Add(new PipelineConfigurationAnnotation(context => 312dashboard.Annotations.Add(new DeploymentTargetAnnotation(dashboardService)
DockerComposeServiceResource.cs (1)
40Annotations.Add(new PipelineStepAnnotation(_ =>
Aspire.Hosting.Dotnet (18)
DotnetProjectBuildCoordinator.cs (14)
96buildResource.Annotations.Add(NameValidationPolicyAnnotation.None); 127if (resource.Annotations.OfType<WaitAnnotation>().Any( 134var existingAnnotations = resource.Annotations.ToHashSet(ReferenceEqualityComparer.Instance); 137var addedAnnotations = resource.Annotations 150resource.Annotations.Remove(annotation); 160var existingAnnotations = resource.Annotations.ToHashSet(ReferenceEqualityComparer.Instance); 163var addedAnnotations = resource.Annotations 176resource.Annotations.Remove(annotation); 329resource.Annotations.OfType<DotnetProjectMetadata>().SingleOrDefault() is not { } metadata || 435registration.Resource.Annotations.OfType<DotnetProjectMetadata>().Single())) 592if (resource.Annotations.OfType<DotnetProjectMetadata>().SingleOrDefault() is { } metadata && 718foreach (var annotation in entry.Registration.Resource.Annotations 727entry.Registration.Resource.Annotations.Remove(annotation); 859entry.Registration.Resource.Annotations.OfType<DotnetProjectBuildEnvironmentCallbackAnnotation>();
DotnetProjectBuildResource.cs (1)
355var executableAnnotation = Annotations.OfType<ExecutableAnnotation>().Single();
DotnetProjectHostingExtensions.cs (2)
159if (builder.Resource.Annotations.OfType<DotnetProjectMetadata>().SingleOrDefault() is { } metadata) 380var projectLaunchConfigurationType = resource.Resource.Annotations
DotnetProjectResource.cs (1)
44Annotations.Add(new ProjectLaunchDefaultsAnnotation());
Aspire.Hosting.Dotnet.Tests (92)
DotnetProjectBuildCoordinatorTests.cs (46)
58Assert.Single(api.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()).LaunchConfigurationType); 61Assert.Single(worker.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()).LaunchConfigurationType); 62Assert.Empty(buildResource.Annotations.OfType<ExplicitStartupAnnotation>()); 63var hidden = Assert.Single(buildResource.Annotations.OfType<HiddenAnnotation>()); 68Assert.Single(buildResource.Annotations.OfType<ManifestPublishingCallbackAnnotation>())); 279Assert.Empty(project.Resource.Annotations.OfType<DotnetProgramBuildCompletionAnnotation>()); 280Assert.False(Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()).SuppressBuild); 283Assert.Single(project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()).LaunchConfigurationType); 305Assert.True(Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()).SuppressBuild); 308Assert.Single(project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()).LaunchConfigurationType); 330Assert.Single(project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()).LaunchConfigurationType); 351Assert.False(Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()).SuppressBuild); 354Assert.Single(project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()).LaunchConfigurationType); 708var metadata = Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()); 710Assert.Empty(project.Resource.Annotations.OfType<WaitAnnotation>()); 917Assert.Null(Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()).BuildWorkingDirectory); 1561resource.Resource.Annotations.Add( 1639var metadata = Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()); 2027var metadata = Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()); 2081var metadata = Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()); 2101var launchTool = Assert.Single(project.Resource.Annotations.OfType<LaunchToolArgsCallbackAnnotation>()); 2261project.Resource.Annotations 2267project.Resource.Annotations 2572Assert.True(Assert.Single(missing.Resource.Annotations.OfType<DotnetProjectMetadata>()).SuppressBuild); 2600conflictingResource.Annotations.Add(NameValidationPolicyAnnotation.None); 2616var executableAnnotation = Assert.Single(primaryBuildResource.Annotations.OfType<ExecutableAnnotation>()); 2623.Annotations.OfType<DotnetProjectMetadata>().Single().BuildWorkingDirectory); 2627.Annotations.OfType<DotnetProjectMetadata>().Single().BuildWorkingDirectory); 2667Assert.Single(first.Resource.Annotations.OfType<DotnetProjectMetadata>()).ProjectPath); 2670Assert.Single(second.Resource.Annotations.OfType<DotnetProjectMetadata>()).ProjectPath); 3040Assert.False(missing.Resource.Annotations.OfType<DotnetProjectMetadata>().Single().SuppressBuild); 3042missing.Resource.Annotations.OfType<SupportsDebuggingAnnotation>(), 3079Assert.False(Assert.Single(missing.Resource.Annotations.OfType<DotnetProjectMetadata>()).SuppressBuild); 3081missing.Resource.Annotations.OfType<SupportsDebuggingAnnotation>(), 3229var metadata = Assert.Single(project.Resource.Annotations.OfType<DotnetProjectMetadata>()); 3256var launchTool = Assert.Single(project.Resource.Annotations.OfType<LaunchToolArgsCallbackAnnotation>()); 3288var completion = Assert.Single(project.Resource.Annotations.OfType<DotnetProgramBuildCompletionAnnotation>()); 3392var completion = Assert.Single(project.Resource.Annotations.OfType<DotnetProgramBuildCompletionAnnotation>()); 3438var completion = Assert.Single(project.Resource.Annotations.OfType<DotnetProgramBuildCompletionAnnotation>()); 3472var completion = Assert.Single(project.Resource.Annotations.OfType<DotnetProgramBuildCompletionAnnotation>()); 3521conflict.Annotations.Add(NameValidationPolicyAnnotation.None); 3524var completion = Assert.Single(project.Resource.Annotations.OfType<DotnetProgramBuildCompletionAnnotation>()); 3618buildResource.Annotations.OfType<ExecutableAnnotation>().Single().Command = 4159resource.Annotations.OfType<WaitAnnotation>(), 4165resource.Annotations.OfType<ResourceRelationshipAnnotation>(), 4175resource.Annotations.OfType<WaitAnnotation>(),
DotnetProjectBuildEnvironmentTests.cs (2)
79Assert.Single(project.Resource.Annotations.OfType<DotnetProjectBuildEnvironmentCallbackAnnotation>()); 80Assert.Single(project.Resource.Annotations.OfType<DotnetProgramBuildEnvironmentCallbackAnnotation>());
DotnetProjectFacadeTests.cs (8)
24Assert.Equal(3, Assert.Single(resource.Resource.Annotations.OfType<ReplicaAnnotation>()).Replicas); 25Assert.Single(resource.Resource.Annotations.OfType<DisableForwardedHeadersAnnotation>()); 26var filter = Assert.Single(resource.Resource.Annotations.OfType<EndpointEnvironmentInjectionFilterAnnotation>()).Filter; 30Assert.Single(resource.Resource.Annotations.OfType<IProjectMetadata>()), 123foreach (var endpoint in resource.Resource.Annotations.OfType<EndpointAnnotation>()) 145resource.Resource.Annotations.Add(replacement); 150resource.Resource.Annotations.Remove(original); 182Assert.Equal(2, Assert.Single(legacy.Resource.Annotations.OfType<ReplicaAnnotation>()).Replicas);
DotnetProjectLaunchProfileTests.cs (16)
46Assert.Single(resource.Resource.Annotations.OfType<IProjectMetadata>()); 49var endpoint = Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 61Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 96Assert.Equal(port, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 100Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 138Assert.Equal(port, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 142Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 180Assert.Equal(5111, Assert.Single(modern.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 183Assert.Equal(5222, Assert.Single(legacy.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 187Assert.Empty(legacy.Resource.Annotations.OfType<EndpointAnnotation>()); 211Assert.Equal(5222, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 215Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 233Assert.Equal(5222, Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>()).Port); 237Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 255Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>()); 273Assert.Empty(resource.Resource.Annotations.OfType<EndpointAnnotation>());
DotnetProjectOptionsTests.cs (1)
60var endpoint = Assert.Single(resource.Resource.Annotations.OfType<EndpointAnnotation>());
DotnetProjectPathTests.cs (5)
41Assert.Equal(iconName, Assert.Single(resource.Resource.Annotations.OfType<ResourceIconAnnotation>()).IconName); 42Assert.Equal(iconName, Assert.Single(relativeResource.Resource.Annotations.OfType<ResourceIconAnnotation>()).IconName); 75Assert.Equal(iconName, Assert.Single(absolute.Resource.Annotations.OfType<ResourceIconAnnotation>()).IconName); 76Assert.Equal(iconName, Assert.Single(relative.Resource.Annotations.OfType<ResourceIconAnnotation>()).IconName); 244var icon = Assert.Single(resource.Resource.Annotations.OfType<ResourceIconAnnotation>());
DotnetProjectPublicApiTests.cs (1)
116project.Resource.Annotations.Add(new DotnetProjectMetadata("app.cs", buildConfiguration: null, "app"));
DotnetProjectResourceTests.cs (13)
197Assert.Single(resource.Resource.Annotations.OfType<PipelineStepAnnotation>()); 198Assert.Single(resource.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 199Assert.Single(resource.Resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>()); 436var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 437var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 485var annotation = app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 501var launchDefaults = Assert.Single(project.Resource.Annotations.OfType<ProjectLaunchDefaultsAnnotation>()); 556var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()); 573var restartCommand = resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 588resource.Annotations.OfType<ResourceCommandAnnotation>(), 601var restartCommand = resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 604Assert.Contains(resource.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == KnownResourceCommands.RebuildCommand); 700Assert.Empty(app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>());
Aspire.Hosting.DotnetTool.Tests (10)
AddDotnetToolTests.cs (10)
30var annotation = Assert.Single(tool.Resource.Annotations.OfType<DotnetToolAnnotation>()); 64var annotation = Assert.Single(tool.Resource.Annotations.OfType<ResourceIconAnnotation>()); 280var annotation = tool.Resource.Annotations.OfType<DotnetToolAnnotation>().Single(); 291var annotation = tool.Resource.Annotations.OfType<DotnetToolAnnotation>().Single(); 302var annotation = tool.Resource.Annotations.OfType<DotnetToolAnnotation>().Single(); 314var annotation = tool.Resource.Annotations.OfType<DotnetToolAnnotation>().Single(); 325var annotation = tool.Resource.Annotations.OfType<DotnetToolAnnotation>().Single(); 336var annotation = tool.Resource.Annotations.OfType<DotnetToolAnnotation>().Single(); 337tool.Resource.Annotations.Remove(annotation); 427var annotation = Assert.Single(tool.Resource.Annotations.OfType<RequiredCommandAnnotation>());
Aspire.Hosting.EntityFrameworkCore (8)
EFCoreOperationExecutor.cs (6)
142var execAnnotation = _toolResource.Annotations.OfType<ExecutableAnnotation>().FirstOrDefault(); 145_toolResource.Annotations.Remove(execAnnotation); 146_toolResource.Annotations.Add(new ExecutableAnnotation 306_toolResource.Annotations.Add(argsAnnotation); 382_toolResource.Annotations.Remove(argsAnnotation); 467if (toolResource.Annotations.OfType<ResourceCommandAnnotation>().Any(a => a.Name == KnownResourceCommands.StartCommand))
EFMigrationResourceBuilderExtensions.cs (1)
358migrationResource.Annotations.Add(new EnvironmentCallbackAnnotation(context =>
EFResourceBuilderExtensions.cs (1)
497var executableAnnotation = toolResource.Annotations.OfType<ExecutableAnnotation>().LastOrDefault();
Aspire.Hosting.EntityFrameworkCore.Tests (40)
AddEFMigrationsTests.cs (2)
235var snapshotAnnotation = migrations.Resource.Annotations.OfType<ResourceSnapshotAnnotation>().FirstOrDefault(); 248var iconAnnotation = migrations.Resource.Annotations.OfType<ResourceIconAnnotation>().FirstOrDefault();
EFCoreOperationExecutorTests.cs (4)
189tool.Resource.Annotations.Add(firstCommand); 197tool.Resource.Annotations.Remove(firstCommand); 198tool.Resource.Annotations.Add(new CommandLineArgsCallbackAnnotation(args => args.Add("second"))); 217toolResource.Annotations.Add(new ResourceCommandAnnotation(
EFMigrationCommandsTests.cs (14)
22var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 36var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 51var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 66var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 84var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 98var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 112var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 126var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 151var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 166var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 182var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 198var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 228var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 258var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList();
EFMigrationPipelineTests.cs (10)
56foreach (var annotation in migrations.Resource.Annotations.OfType<PipelineStepAnnotation>()) 303var waitAnnotations = migrations.Resource.Annotations.OfType<WaitAnnotation>().ToList(); 323var waitAnnotations = migrations.Resource.Annotations.OfType<WaitAnnotation>().ToList(); 335var waitAnnotations = migrations.Resource.Annotations.OfType<WaitAnnotation>().ToList(); 346var startCommand = migrations.Resource.ToolResource.Annotations 470var dockerfileAnnotation = Assert.Single(migrations.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 492Assert.Empty(migrations.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 507Assert.Empty(migrations.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 766var waitedResources = migrations.Resource.Annotations.OfType<WaitAnnotation>().Select(w => w.Resource).ToList(); 870foreach (var annotation in migrationResource.Annotations.OfType<PipelineStepAnnotation>())
EFMigrationResourceTests.cs (3)
45Assert.Empty(resource.Annotations); 81migrations.Resource.Annotations.OfType<ResourceRelationshipAnnotation>(), 84Assert.Single(migrations.Resource.Annotations.OfType<PipelineStepAnnotation>());
EFMigrationWaitForTests.cs (6)
26var waitAnnotation = anotherProject.Resource.Annotations.OfType<WaitAnnotation>().FirstOrDefault(); 43var wait1 = project1.Resource.Annotations.OfType<WaitAnnotation>().FirstOrDefault(w => w.Resource == migrations.Resource); 44var wait2 = project2.Resource.Annotations.OfType<WaitAnnotation>().FirstOrDefault(w => w.Resource == migrations.Resource); 62var waitAnnotations = anotherProject.Resource.Annotations.OfType<WaitAnnotation>().ToList(); 79Assert.NotNull(anotherProject.Resource.Annotations.OfType<WaitAnnotation>().FirstOrDefault()); 92var waitAnnotation = container.Resource.Annotations.OfType<WaitAnnotation>().FirstOrDefault();
TestServices\TestEfTool.cs (1)
22Resource.Annotations.Add(new ResourceCommandAnnotation(
Aspire.Hosting.Foundry (12)
FoundryExtensions.cs (1)
223resource.Annotations.Add(new EmulatorResourceAnnotation());
HostedAgent\AzureHostedAgentResource.cs (3)
40Annotations.Add(new ManifestPublishingCallbackAnnotation(PublishAsync)); 42Annotations.Add(new PipelineStepAnnotation(async (ctx) => 70Annotations.Add(new PipelineConfigurationAnnotation(async (context) =>
HostedAgent\HostedAgentBuilderExtension.cs (1)
453projectResource.Annotations.Add(new RequiresHostedAgentRegistryAnnotation());
Project\ProjectResource.cs (1)
41Annotations.Add(new PipelineStepAnnotation(async (factoryContext) =>
PromptAgent\AzurePromptAgentResource.cs (2)
61Annotations.Add(new ManifestPublishingCallbackAnnotation(PublishAsync)); 64Annotations.Add(new PipelineStepAnnotation(context =>
Toolbox\FoundryToolboxBuilderExtensions.cs (1)
64toolbox.Annotations.Add(new ReferenceRoleAssignmentAnnotation(builder.Resource, roles));
Toolbox\FoundryToolboxResource.cs (3)
51Annotations.Add(new PipelineStepAnnotation(context => 104Annotations.Add(new PipelineConfigurationAnnotation(context => 169Annotations.OfType<FoundryToolboxExistingResourceAnnotation>().LastOrDefault() is not null;
Aspire.Hosting.Foundry.Tests (18)
HostedAgentExtensionTests.cs (6)
173var endpoint = Assert.Single(agent.Resource.Annotations.OfType<EndpointAnnotation>()); 386Assert.DoesNotContain(hostedAgent.Annotations.OfType<ResourceRelationshipAnnotation>(), r => 456Assert.DoesNotContain(agent.Resource.Annotations, annotation => annotation is DockerfileBuildAnnotation); 457Assert.Contains(agent.Resource.Annotations, annotation => annotation is EndpointEnvironmentInjectionFilterAnnotation); 882Assert.Contains(app.Resource.Annotations.OfType<WaitAnnotation>(), w => ReferenceEquals(w.Resource, project.Resource)); 931var registryTargets = container.Resource.Annotations.OfType<RegistryTargetAnnotation>().ToList();
PromptAgentTests.cs (2)
186var command = Assert.Single(agent.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 681var annotations = agent.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList();
ToolboxTests.cs (10)
36toolbox.Resource.Annotations.OfType<ResourceRelationshipAnnotation>()); 42toolbox.Resource.Annotations.OfType<ReferenceRoleAssignmentAnnotation>()); 275var annotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineStepAnnotation>()); 305var annotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineStepAnnotation>()); 811var toolboxStepAnnotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineStepAnnotation>()); 834var configAnnotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 853var toolboxStepAnnotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineStepAnnotation>()); 870var configAnnotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 892var toolboxStepAnnotation = Assert.Single(toolbox.Resource.Annotations.OfType<PipelineStepAnnotation>()); 909toolbox.Resource.Annotations.OfType<PipelineConfigurationAnnotation>());
Aspire.Hosting.Garnet.Tests (6)
AddGarnetTests.cs (6)
27var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 36var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 55var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 64var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 214var volumeAnnotation = garnet.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 239var volumeAnnotation = garnet.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Go (2)
GoHostingExtensions.cs (2)
761var debuggingAnnotation = builder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 764builder.Resource.Annotations.Remove(debuggingAnnotation);
Aspire.Hosting.Go.Tests (1)
AddGoAppTests.cs (1)
648var debugAnnotation = app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().Last();
Aspire.Hosting.Java (6)
JavaHostingExtensions.cs (6)
116resource.Annotations.Add(new JavaAuthoredDockerfileAnnotation()); 590var annotation = resource.Annotations.OfType<JavaDetectedBuildToolAnnotation>().Single(); 915foreach (var annotation in builder.Resource.Annotations 922builder.Resource.Annotations.Remove(annotation); 964foreach (var buildStep in builder.Resource.Annotations.OfType<JavaBuildStepAnnotation>()) 1558if (builder.Resource.Annotations.OfType<JavaWrapperValidationAnnotation>().Any(a => a.Tool == tool))
Aspire.Hosting.Java.Tests (25)
AddJavaAppTests.cs (6)
1140Assert.Null(Assert.Single(app.Resource.Annotations.OfType<JavaBuildStepAnnotation>()).ResourceName); 1197var annotation = app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 1209var annotation = app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 1261Assert.Empty(app.Resource.Annotations.OfType<WaitAnnotation>()); 1262Assert.Null(Assert.Single(app.Resource.Annotations.OfType<JavaBuildStepAnnotation>()).ResourceName); 1356var annotation = Assert.Single(app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>());
AddJavaContainerTests.cs (5)
64var image = Assert.Single(app.Resource.Annotations.OfType<ContainerImageAnnotation>()); 76var image = Assert.Single(app.Resource.Annotations.OfType<ContainerImageAnnotation>()); 90var icon = Assert.Single(app.Resource.Annotations.OfType<ResourceIconAnnotation>()); 103Assert.Empty(app.Resource.Annotations.OfType<EndpointAnnotation>()); 153var scope = Assert.Single(app.Resource.Annotations.OfType<CertificateAuthorityCollectionAnnotation>());
AddQuarkusAppTests.cs (6)
35app.Resource.Annotations.OfType<WaitAnnotation>(), 51Assert.Empty(app.Resource.Annotations.OfType<WaitAnnotation>()); 68Assert.Empty(app.Resource.Annotations.OfType<WaitAnnotation>()); 144var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()); 161var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()); 272Assert.Empty(app.Resource.Annotations.OfType<HealthCheckAnnotation>());
AddSpringBootAppTests.cs (8)
78var runTool = Assert.Single(runApp.Resource.Annotations.OfType<JavaBuildToolAnnotation>()).Tool; 141Assert.Equal(["verify"], Assert.Single(app.Resource.Annotations.OfType<JavaBuildStepAnnotation>()).Args); 142Assert.Equal(["spring-boot:run"], Assert.Single(app.Resource.Annotations.OfType<JavaBuildToolAnnotation>()).Args); 156var endpoint = Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()); 176Assert.Empty(app.Resource.Annotations.OfType<HealthCheckAnnotation>()); 301app.Resource.Annotations.OfType<WaitAnnotation>(), 324Assert.Empty(app.Resource.Annotations.OfType<WaitAnnotation>()); 365Assert.True(Assert.Single(app.Resource.Annotations.OfType<EndpointAnnotation>()).IsExternal);
Aspire.Hosting.JavaScript (13)
DenoHostingExtensions.cs (4)
384builder.Resource.Annotations.Remove(environmentCallback); 389builder.Resource.Annotations.Remove(endpoint); 422var existingEndpoint = builder.Resource.Annotations 431var serveEndpoint = builder.Resource.Annotations
JavaScriptHostingExtensions.cs (9)
351if (!resource.Annotations.OfType<RequiredCommandAnnotation>().Any(a => string.Equals(a.Command, command, StringComparison.Ordinal))) 353resource.Annotations.Add(new RequiredCommandAnnotation(command) { HelpLink = helpLink }); 1536if (!builder.Resource.Annotations.OfType<OtlpExporterAnnotation>().Any()) 3034installer.Annotations.Add(NameValidationPolicyAnnotation.None); 3091resource.Resource.Annotations.OfType<WaitAnnotation>() 3094.ForEach(w => resource.Resource.Annotations.Remove(w)); 3102installer.Resource.Annotations.OfType<ExplicitStartupAnnotation>() 3104.ForEach(a => installer.Resource.Annotations.Remove(a)); 3108if (!resource.Resource.Annotations.OfType<WaitAnnotation>().Any(w => w.Resource == installer.Resource))
Aspire.Hosting.JavaScript.Tests (56)
AddBunAppTests.cs (6)
50var dockerBuildAnnotation = bunApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 53Assert.Empty(bunApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>()); 102var dockerBuildAnnotation = bunApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 311var annotation = bunApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 324var annotation = bunApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 337var annotation = bunApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault();
AddDenoAppTests.cs (19)
45var exporter = Assert.Single(denoApp.Resource.Annotations.OfType<OtlpExporterAnnotation>()); 78var dockerBuildAnnotation = denoApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 81Assert.Empty(denoApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>()); 135var dockerBuildAnnotation = denoApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 331var exporter = Assert.Single(app.Resource.Annotations.OfType<OtlpExporterAnnotation>()); 1128var initialEnvironmentCallbackCount = denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count(); 1135Assert.Empty(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1136Assert.Equal(initialEnvironmentCallbackCount, denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count()); 1159var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1188var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1205var initialEnvironmentCallbackCount = denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count(); 1209var endpoint = Assert.Single(denoApp.Resource.Annotations.OfType<EndpointAnnotation>()); 1212Assert.Equal(initialEnvironmentCallbackCount, denoApp.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Count()); 1515Assert.Contains(app.Resource.Annotations.OfType<WaitAnnotation>(), wait => wait.Resource == installer); 1532Assert.DoesNotContain(app.Resource.Annotations.OfType<WaitAnnotation>(), wait => wait.Resource == installer); 1550Assert.Single(app.Resource.Annotations.OfType<WaitAnnotation>(), wait => wait.Resource == installer); 2531var annotation = denoApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 2544var annotation = denoApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 2557var annotation = denoApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault();
AddJavaScriptAppTests.cs (1)
38var dockerBuildAnnotation = yarnApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
AddNodeAppTests.cs (6)
155var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 158Assert.Empty(nodeApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>()); 442var annotation = nodeApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 455var annotation = nodeApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 467var annotation = viteApp.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 494var annotation = browserDebuggerResource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault();
AddViteAppTests.cs (20)
74var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 77var containerFilesSource = nodeApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>().Single(); 100var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 103var containerFilesSource = nodeApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>().Single(); 204var dockerBuildAnnotation = nodeApp.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 207var containerFilesSource = nodeApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>().Single(); 230var containerFilesSource = nodeApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>().Single(); 252Assert.Empty(nodeApp.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>()); 506var commandLineArgsAnnotation = nodeResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().First(); 531var commandLineArgsAnnotation = nodeResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().First(); 562var certConfigAnnotation = nodeResource.Annotations 622var certConfigAnnotation = nodeResource.Annotations 674var certConfigAnnotation = nodeResource.Annotations 721var certConfigAnnotation = nodeResource.Annotations 769var certConfigAnnotation = nodeResource.Annotations 832var certConfigAnnotation = viteResource.Annotations 926var certConfigAnnotation = resource.Annotations 1009var certConfigAnnotation = nodeResource.Annotations 1054var stepAnnotations = nodeApp.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 1122var certConfigAnnotation = resource.Annotations
AddViteAppWithPnpmTests.cs (4)
31var commandLineArgsAnnotation = nodeResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().First(); 65var commandLineArgsAnnotation = nodeResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().First(); 93var commandLineArgsAnnotation = nodeResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().First(); 126var commandLineArgsAnnotation = nodeResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().First();
Aspire.Hosting.Kafka.Tests (5)
AddKafkaTests.cs (5)
90var endpoints = containerResource.Annotations.OfType<EndpointAnnotation>(); 111var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 185var volumeAnnotation = kafka.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 203var volumeAnnotation = kafka.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 255var hidden = Assert.Single(kafkaUi.Annotations.OfType<HiddenAnnotation>());
Aspire.Hosting.Keycloak.Tests (8)
KeycloakPublicApiTests.cs (2)
163var containerAnnotation = keycloak.Resource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single(); 188var containerAnnotation = keycloak.Resource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>().Single();
KeycloakResourceBuilderTests.cs (6)
34var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == defaultEndpointName); 45var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == managementEndpointName); 54var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 83var endpoints = keycloak.Resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 105var volumeAnnotation = keycloak.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 120var volumeAnnotation = keycloak.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
Aspire.Hosting.Kubernetes (6)
KubernetesEnvironmentResource.cs (5)
229Annotations.Add(new PipelineStepAnnotation(async (factoryContext) => 367Annotations.Add(new PipelineConfigurationAnnotation(context => 446!dashboard.Annotations.OfType<DeploymentTargetAnnotation>().Any(a => a.ComputeEnvironment == targetComputeEnvironment)) 451dashboard.Annotations.Add(new DeploymentTargetAnnotation(dashboardService) 1059foreach (var annotation in volumeResource.Annotations.OfType<KubernetesPersistentVolumeCustomizationAnnotation>())
KubernetesResource.cs (1)
32Annotations.Add(new PipelineStepAnnotation(_ =>
Aspire.Hosting.Kubernetes.Tests (12)
KubernetesDeployTests.cs (2)
266var annotations = env.Annotations.OfType<HelmChartNameAnnotation>().ToList(); 283var nsAnnotations = env.Annotations.OfType<KubernetesNamespaceAnnotation>().ToList();
KubernetesHelmChartTests.cs (1)
519foreach (var annotation in resource.Annotations.OfType<PipelineStepAnnotation>())
KubernetesPersistentVolumeRunModeTests.cs (9)
180var firstMount = Assert.Single(firstContainer.Resource.Annotations.OfType<ContainerMountAnnotation>()); 181var secondMount = Assert.Single(secondContainer.Resource.Annotations.OfType<ContainerMountAnnotation>()); 209var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>()); 227var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>()); 259var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>()); 318var firstMount = Assert.Single(firstContainer.Resource.Annotations.OfType<ContainerMountAnnotation>()); 319var secondMount = Assert.Single(secondContainer.Resource.Annotations.OfType<ContainerMountAnnotation>()); 339var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>()); 353var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>());
Aspire.Hosting.Maui (3)
MauiOtlpExtensions.cs (1)
79parentBuilder.Resource.Annotations.Add(tunnelConfig);
MauiProjectResourceExtensions.cs (1)
68resource.Annotations.Add(new MauiBuildQueueAnnotation());
Otlp\OtlpLoopbackResource.cs (1)
47Annotations.Add(OtlpEndpoint);
Aspire.Hosting.Maui.Tests (49)
MauiBuildQueueTests.cs (10)
36parent.Annotations.Add(new MauiBuildQueueAnnotation()); 430parent.Annotations.Add(new MauiBuildQueueAnnotation()); 567var stopCommand = env.Android.Annotations 600var stopCommand = env.Android.Annotations 681env.Android.Annotations.Add(new MauiBuildInfoAnnotation( 686env.MacCatalyst.Annotations.Add(new MauiBuildInfoAnnotation( 1091env.Android.Annotations.Add(new MauiBuildInfoAnnotation( 1356parent.Annotations.Add(new MauiBuildQueueAnnotation()); 1387parent1.Annotations.Add(new MauiBuildQueueAnnotation()); 1393parent2.Annotations.Add(new MauiBuildQueueAnnotation());
MauiPlatformExtensionsTests.cs (33)
463var debugSupport = Assert.Single(simulator.Resource.Annotations.OfType<SupportsDebuggingAnnotation>()); 468foreach (var argsAnnotation in simulator.Resource.Annotations.OfType<CommandLineArgsCallbackAnnotation>()) 673var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().FirstOrDefault(); 698var annotations = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().ToList(); 736var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 753dashboard.Resource.Annotations.Add(new EndpointAnnotation( 764var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 773var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 806dashboard.Resource.Annotations.Add(new EndpointAnnotation( 812dashboard.Resource.Annotations.Add(new EndpointAnnotation( 820var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 824var httpEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>() 827var grpcEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>() 878dashboard.Resource.Annotations.Add(dashboardEndpoint); 882var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 909dashboard.Resource.Annotations.Add(new EndpointAnnotation( 917var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 934var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 972dashboard.Resource.Annotations.Add(dashboardEndpoint); 974var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1031var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1067var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1108var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1140var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1165var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1192dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1200var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1212var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 1274dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1282var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1310dashboard.Resource.Annotations.Add(new EndpointAnnotation( 1318var tunnelConfig = maui.Resource.Annotations.OfType<OtlpDevTunnelConfigurationAnnotation>().Single(); 1322var dashboardEndpoint = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single();
MauiUnsupportedPlatformTests.cs (6)
24var annotation = windows.Resource.Annotations.OfType<UnsupportedPlatformAnnotation>().FirstOrDefault(); 48var annotation = macCatalyst.Resource.Annotations.OfType<UnsupportedPlatformAnnotation>().FirstOrDefault(); 72var annotation = iosDevice.Resource.Annotations.OfType<UnsupportedPlatformAnnotation>().FirstOrDefault(); 96var annotation = iosSimulator.Resource.Annotations.OfType<UnsupportedPlatformAnnotation>().FirstOrDefault(); 121var annotation = androidDevice.Resource.Annotations.OfType<UnsupportedPlatformAnnotation>().FirstOrDefault(); 136var annotation = androidEmulator.Resource.Annotations.OfType<UnsupportedPlatformAnnotation>().FirstOrDefault();
Aspire.Hosting.Milvus.Tests (5)
AddMilvusTests.cs (5)
201Assert.Single(milvusResource.Annotations.OfType<EndpointAnnotation>()); 203var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 219var hidden = Assert.Single(attu.Annotations.OfType<HiddenAnnotation>()); 221Assert.Single(attu.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Parent" && r.Resource == milvus.Resource); 222Assert.Single(attu.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Manages" && r.Resource == milvus.Resource);
Aspire.Hosting.MongoDB (1)
ReplicaSet\MongoDBReplicaSetResource.cs (1)
77public IEnumerable<MongoDBServerResource> Members => Annotations.OfType<MongoReplicaSetMemberAnnotation>().Select(a => a.Member);
Aspire.Hosting.MongoDB.Tests (39)
AddMongoDBTests.cs (14)
25Assert.Single(mongo.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "mongodb_check"); 33Assert.Single(db.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "mydb_check"); 50var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 59var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 78var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 87var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 143var wait = Assert.Single(mongoExpress.Annotations.OfType<WaitAnnotation>()); 173Assert.Collection(mongoExpress.Annotations.OfType<WaitAnnotation>(), 184var memberWait = Assert.Single(replicaSet.Resource.Annotations.OfType<WaitAnnotation>()); 201var containerAnnotation = Assert.Single(resource.Annotations.OfType<ContainerImageAnnotation>()); 217var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 284var hidden = Assert.Single(mongoExpress.Annotations.OfType<HiddenAnnotation>()); 286Assert.Single(mongoExpress.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Parent" && r.Resource == mongo.Resource); 287Assert.Single(mongoExpress.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Manages" && r.Resource == mongo.Resource);
MongoDBReplCommandTests.cs (1)
125var callback = Assert.Single(mongo.Resource.Annotations.OfType<CertificateTrustConfigurationCallbackAnnotation>());
ReplicaSet\AddMongoDBReplicaSetTests.cs (8)
26Assert.Single(rs.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "rs0_check"); 50var wait = Assert.Single(rs.Resource.Annotations.OfType<WaitAnnotation>(), 175var memberAnnotations = member.Resource.Annotations.ToArray(); 176var replicaSetAnnotations = rs.Resource.Annotations.ToArray(); 183Assert.Equal(memberAnnotations, member.Resource.Annotations); 184Assert.Equal(replicaSetAnnotations, rs.Resource.Annotations); 198var annotation = Assert.Single(mongo1.Resource.Annotations.OfType<HttpsCertificateAnnotation>()); 210var annotation = Assert.Single(mongo1.Resource.Annotations.OfType<HttpsCertificateAnnotation>());
SingleMemberReplicaSetTests.cs (12)
34var endpoint = Assert.Single(mongo.Resource.Annotations.OfType<EndpointAnnotation>()); 38Assert.Single(mongo.Resource.Annotations.OfType<MongoDBSingleMemberReplicaSetAnnotation>()); 40Assert.Single(mongo.Resource.Annotations.OfType<MongoDBServerKeyFileAnnotation>()).Value).Secret); 51Assert.Same(key.Resource, Assert.Single(mongo.Resource.Annotations.OfType<MongoDBServerKeyFileAnnotation>()).Value); 62var annotations = mongo.Resource.Annotations.ToArray(); 65Assert.Equal(annotations, mongo.Resource.Annotations); 77var annotations = mongo.Resource.Annotations.ToArray(); 82Assert.Equal(annotations, mongo.Resource.Annotations); 93var annotations = mongo.Resource.Annotations.ToArray(); 96Assert.Equal(annotations, mongo.Resource.Annotations); 105var annotations = mongo.Resource.Annotations.ToArray(); 109Assert.Equal(annotations, mongo.Resource.Annotations);
tests\Shared\ContainerReplCommandTestBase.cs (4)
29var commands = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 51var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 81var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 104var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
206var scriptAnnotation = sqlDatabase.Annotations.OfType<MySqlCreateDatabaseScriptAnnotation>().LastOrDefault();
Aspire.Hosting.MySql.Tests (9)
AddMySqlTests.cs (5)
49var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 54var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 233Assert.Single(phpMyAdmin.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Manages" && r.Resource == mySql1.Resource); 234Assert.Single(phpMyAdmin.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Manages" && r.Resource == mySql2.Resource); 244var hidden = Assert.Single(phpMyAdmin.Annotations.OfType<HiddenAnnotation>());
tests\Shared\ContainerReplCommandTestBase.cs (4)
29var commands = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 51var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 81var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 104var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.Nats.Tests (5)
AddNatsTests.cs (5)
104var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 113var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 146var mountAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerMountAnnotation>()); 150var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 159var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>());
Aspire.Hosting.OpenAI.Tests (4)
OpenAIExtensionTests.cs (1)
232var healthCheckAnnotations = openai.Resource.Annotations.OfType<HealthCheckAnnotation>().ToList();
OpenAIFunctionalTests.cs (3)
77Assert.Single(resource.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "resource_check"); 80var statusPageHealthCheck = Enumerable.Single(resource.Resource.Annotations, x => x is HealthCheckAnnotation hca && hca.Key == "resource_check"); 81resource.Resource.Annotations.Remove(statusPageHealthCheck);
Aspire.Hosting.PostgreSQL (2)
PostgresBuilderExtensions.cs (2)
769if (builder.Resource.Annotations.OfType<ContainerImageAnnotation>().LastOrDefault() is { } imageAnnotation) 807var scriptAnnotation = npgsqlDatabase.Annotations.OfType<PostgresCreateDatabaseScriptAnnotation>().LastOrDefault();
Aspire.Hosting.PostgreSQL.Tests (20)
AddPostgresTests.cs (12)
22Assert.Single(redis.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "postgres_check"); 418var hidden = Assert.Single(pgAdmin.Annotations.OfType<HiddenAnnotation>()); 439var hidden = Assert.Single(pgWeb.Annotations.OfType<HiddenAnnotation>()); 455var containerAnnotation = Assert.Single(resource.Annotations.OfType<ContainerImageAnnotation>()); 471var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 700var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 825var volumeAnnotation = postgres.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 852var volumeAnnotation = postgres.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 868var volumeAnnotation = postgres.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 881var volumeAnnotation = postgres.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 906var volumeAnnotation = postgres.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 933var volumeAnnotation = postgres.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
PostgresMcpBuilderTests.cs (4)
32var endpoint = Assert.Single(mcpContainer.Annotations.OfType<EndpointAnnotation>()); 38var mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<McpServerEndpointAnnotation>()); 59var mcpEndpoint = Assert.Single(mcpContainer.Annotations.OfType<EndpointAnnotation>()); 62var mcpAnnotation = Assert.Single(mcpContainer.Annotations.OfType<McpServerEndpointAnnotation>());
tests\Shared\ContainerReplCommandTestBase.cs (4)
29var commands = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 51var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 81var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 104var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.Python (3)
PythonAppResourceBuilderExtensions.cs (3)
1232pythonEnv = builder.Resource.Annotations.OfType<PythonEnvironmentAnnotation>().Last(); 1403installer.Annotations.Add(NameValidationPolicyAnnotation.None); 1477venvCreator.Annotations.Add(NameValidationPolicyAnnotation.None);
Aspire.Hosting.Python.Tests (12)
AddPythonAppTests.cs (12)
220var entrypointAnnotation = resource.Annotations.OfType<PythonEntrypointAnnotation>().Single(); 796var waitAnnotations = pythonAppResource.Annotations.OfType<WaitAnnotation>(); 932var entrypointAnnotation = resource.Annotations.OfType<PythonEntrypointAnnotation>().Single(); 951var entrypointAnnotation = resource.Annotations.OfType<PythonEntrypointAnnotation>().Single(); 970var entrypointAnnotation = resource.Annotations.OfType<PythonEntrypointAnnotation>().Single(); 1165var entrypointAnnotation = resource.Annotations.OfType<PythonEntrypointAnnotation>().Single(); 1707var debugAnnotation = resource.Annotations.OfType<SupportsDebuggingAnnotation>().Last(); 1791var debugAnnotation = resource.Annotations.OfType<SupportsDebuggingAnnotation>().Last(); 2555var installerWaits = installerResource.Annotations.OfType<WaitAnnotation>() 2655var installerWaits = installerResource.Annotations.OfType<WaitAnnotation>() 2785var waitAnnotations = pythonAppResource.Annotations.OfType<WaitAnnotation>().ToList(); 2818var waitAnnotations = pythonAppResource.Annotations.OfType<WaitAnnotation>().ToList();
Aspire.Hosting.Qdrant.Tests (5)
AddQdrantTests.cs (4)
309foreach (var callback in consumer.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>()) 428Assert.Equal(2, qdrantResource.Annotations.OfType<EndpointAnnotation>().Count()); 430var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 438var httpEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
QdrantFunctionalTests.cs (1)
247var urls = qdrant.Resource.Annotations.OfType<ResourceUrlAnnotation>();
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
177var containerAnnotations = builder.Resource.Annotations.OfType<ContainerImageAnnotation>().ToList();
Aspire.Hosting.RabbitMQ.Tests (4)
AddRabbitMQTests.cs (4)
55var primaryEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp"); 66var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "management"); 84var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 144var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>());
Aspire.Hosting.Radius (16)
Publishing\RadCredentialRegisterStep.cs (2)
67var annotation = _environment.Annotations 181var annotation = env.Annotations.OfType<RadiusCloudProvidersAnnotation>().FirstOrDefault();
Publishing\RadiusInfrastructureBuilder.cs (11)
303var secretStoresAnnotation = _environment.Annotations 570foreach (var existing in _environment.Annotations.OfType<RadiusDeployParametersAnnotation>().ToList()) 572_environment.Annotations.Remove(existing); 586_environment.Annotations.Add(new RadiusDeployParametersAnnotation( 1782var annotation = _environment.Annotations 1809var annotation = _environment.Annotations 4909var callbacks = _environment.Annotations 5256var annotation = _environment.Annotations 5477var providers = _environment.Annotations 5505var annotation = _environment.Annotations 5597var annotation = _environment.Annotations
RadiusEnvironmentResource.cs (2)
39Annotations.Add(new PipelineStepAnnotation(_ => 93var hasCloudProviders = Annotations
RadiusExtensions.cs (1)
99builder.Resource.Annotations.Add(new RadiusInfrastructureConfigureAnnotation(configure));
Aspire.Hosting.Radius.Tests (45)
CloudProviders\AdditiveCompatibilityTests.cs (3)
16Assert.Empty(env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>()); 32var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 47Assert.Single(env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>());
CloudProviders\CredentialModeOverrideTests.cs (3)
32var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 50var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 65var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single();
CloudProviders\MultiEnvironmentProvidersTests.cs (5)
29var annA = envA.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 33var annB = envB.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().FirstOrDefault(); 49var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 73var devAnn = envs.Single(e => e.Name == "dev").Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 74var prodAnn = envs.Single(e => e.Name == "prod").Annotations.OfType<RadiusCloudProvidersAnnotation>().Single();
CloudProviders\WithAwsProviderTests.cs (4)
27var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 44var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 134var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 147var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single();
CloudProviders\WithAzureProviderTests.cs (2)
30var annotation = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single(); 123var ann = env.Resource.Annotations.OfType<RadiusCloudProvidersAnnotation>().Single();
Deployment\ControlPlaneVersionGateTests.cs (1)
374var annotation = Assert.Single(environment.Resource.Annotations.OfType<PipelineStepAnnotation>());
Deployment\DeployPipelineIntegrationTests.cs (3)
27var pipelineAnnotations = envResource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 133var annotations = envResource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 168var annotations = envResource.Annotations.OfType<PipelineStepAnnotation>().ToList();
Publishing\BicepGenerationSimpleTests.cs (1)
201var annotations = env.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList();
Publishing\RadiusDeployParametersTests.cs (5)
133radius.Resource.Annotations.Add(new RadiusDeployParametersAnnotation( 158var annotation = Assert.Single(radiusEnv.Annotations.OfType<RadiusDeployParametersAnnotation>()); 181var annotation = Assert.Single(radiusEnv.Annotations.OfType<RadiusDeployParametersAnnotation>()); 210var annotation = Assert.Single(radiusEnv.Annotations.OfType<RadiusDeployParametersAnnotation>()); 304var annotation = Assert.Single(radiusEnv.Annotations.OfType<RadiusDeployParametersAnnotation>());
Publishing\RadiusServiceDiscoveryTests.cs (8)
26resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: 5000, targetPort: 8080)); 37resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http", port: 5000)); 48resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 59resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 71resource.Annotations.Add(https); 72resource.Annotations.Add(new ProjectLaunchDefaultsAnnotation { DefaultHttpsEndpoint = https }); 83resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "one")); 84resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "two"));
RadiusExtensionsTests.cs (2)
171var annotation = project.Resource.Annotations.OfType<ContainerImageAnnotation>().Single(); 209var annotation = Assert.Single(project.Resource.Annotations.OfType<ContainerImageAnnotation>());
Recipes\RecipeParameterIsolationAndFidelityTests.cs (2)
18var devAnn = dev.Resource.Annotations.OfType<RadiusRecipeParametersAnnotation>().Single(); 19var prodAnn = prod.Resource.Annotations.OfType<RadiusRecipeParametersAnnotation>().Single();
Recipes\WithRecipeParametersTests.cs (4)
19var ann = env.Resource.Annotations.OfType<RadiusRecipeParametersAnnotation>().Single(); 33var ann = env.Resource.Annotations.OfType<RadiusRecipeParametersAnnotation>().Single(); 47var ann = env.Resource.Annotations.OfType<RadiusRecipeParametersAnnotation>().Single(); 76var ann = env.Resource.Annotations.OfType<RadiusRecipeParametersAnnotation>().SingleOrDefault();
Secrets\SecretStoreConsumerTests.cs (1)
28var annotation = env.Resource.Annotations.OfType<RadiusSecretStoresAnnotation>().Single();
Secrets\SecretStoreValidationTests.cs (1)
124var annotation = Assert.Single(store.Resource.Annotations.OfType<PipelineStepAnnotation>());
Aspire.Hosting.Redis.Tests (26)
AddRedisTests.cs (22)
28Assert.Single(redis.Resource.Annotations, a => a is HealthCheckAnnotation hca && hca.Key == "redis_check"); 44var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 53var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 72var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 81var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 277var hidden = Assert.Single(commander.Annotations.OfType<HiddenAnnotation>()); 288var hidden = Assert.Single(insight.Annotations.OfType<HiddenAnnotation>()); 312Assert.Single(insight.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Manages" && r.Resource == redis); 338Assert.Single(commander.Annotations.OfType<ResourceRelationshipAnnotation>(), r => r.Type == "Manages" && r.Resource == redis); 445var containerAnnotation = Assert.Single(resource.Annotations.OfType<ContainerImageAnnotation>()); 463var containerAnnotation = Assert.Single(resource.Annotations.OfType<ContainerImageAnnotation>()); 479var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 493var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 505var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>()); 639var volumeAnnotation = redis.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 664var volumeAnnotation = redis.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 861var annotation = Assert.Single(redis.Resource.Annotations.OfType<HttpsCertificateAnnotation>()); 874var annotation = Assert.Single(redis.Resource.Annotations.OfType<HttpsCertificateAnnotation>()); 888var annotation = Assert.Single(redis.Resource.Annotations.OfType<HttpsCertificateAnnotation>()); 903var annotation = Assert.Single(redis.Resource.Annotations.OfType<HttpsCertificateAnnotation>()); 919var annotation = Assert.Single(redis.Resource.Annotations.OfType<HttpsCertificateAnnotation>()); 953var endpoint = Assert.Single(redis.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp");
tests\Shared\ContainerReplCommandTestBase.cs (4)
29var commands = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 51var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 81var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 104var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.RemoteHost.Tests (3)
CapabilityDispatcherTests.cs (3)
100var annotation = Assert.Single(resource.Resource.Annotations.OfType<TerminalAnnotation>()); 167var annotation = Assert.Single(resource.Resource.Annotations.OfType<TerminalAnnotation>()); 204Assert.Empty(resource.Resource.Annotations.OfType<TerminalAnnotation>());
Aspire.Hosting.Rust (6)
RustDockerfileGenerator.cs (2)
174foreach (var annotation in resource.Annotations.OfType<RustCargoArgsCallbackAnnotation>()) 483?? resource.Annotations.OfType<DockerfileBaseImageAnnotation>().LastOrDefault();
RustHostingExtensions.cs (4)
98foreach (var annotation in resource.Annotations.OfType<RustCargoArgsCallbackAnnotation>()) 729var annotations = containerBuilder.Resource.Annotations; 894var baseImages = container.Annotations.OfType<DockerfileBaseImageAnnotation>().LastOrDefault() 895?? resource.Annotations.OfType<DockerfileBaseImageAnnotation>().LastOrDefault();
Aspire.Hosting.Rust.Tests (7)
AddRustAppPublishTests.cs (5)
289Assert.Same(pipelineSteps, Assert.Single(container.Annotations.OfType<PipelineStepAnnotation>())); 539var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 562var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>()); 1017var initialDockerfile = Assert.Single(initialContainer.Annotations.OfType<DockerfileBuildAnnotation>()); 1022var dockerfile = Assert.Single(container.Annotations.OfType<DockerfileBuildAnnotation>());
RustDebugArgsTests.cs (2)
54var debugAnnotation = resource.Annotations.OfType<SupportsDebuggingAnnotation>().Last(); 112var debugAnnotation = resource.Annotations.OfType<SupportsDebuggingAnnotation>().Last();
Aspire.Hosting.Seq.Tests (11)
AddSeqTests.cs (11)
26var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 35var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 54var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 63var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 133var volumeAnnotation = seq.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 158var volumeAnnotation = seq.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 180var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 189var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 195var envAnnotations = containerResource.Annotations.OfType<EnvironmentCallbackAnnotation>(); 213var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 222var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>());
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
379var scriptAnnotation = sqlDatabase.Annotations.OfType<SqlServerCreateDatabaseScriptAnnotation>().LastOrDefault();
Aspire.Hosting.SqlServer.Tests (9)
AddSqlServerTests.cs (3)
52var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 61var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 264var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>());
SqlServerReplCommandTests.cs (2)
67Assert.Equal(expectedCalls, sqlServer.Resource.Annotations.OfType<ResourceCommandAnnotation>().Count()); 83Assert.Empty(sqlServer.Resource.Annotations.OfType<ResourceCommandAnnotation>());
tests\Shared\ContainerReplCommandTestBase.cs (4)
29var commands = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 51var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 81var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 104var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.Testing.Tests (2)
TestingPublicApiTests.cs (2)
207resource.Annotations.Add(CreateAllocatedEndpoint("http", 5000)); 208resource.Annotations.Add(CreateAllocatedEndpoint("https", 5001));
Aspire.Hosting.Tests (458)
AddConnectionStringTests.cs (1)
59var annotation = connectionStringResource.Annotations.OfType<ResourceSnapshotAnnotation>().SingleOrDefault();
AddParameterTests.cs (4)
30var annotation = parameterResource.Annotations.OfType<ResourceSnapshotAnnotation>().SingleOrDefault(); 713Assert.True(parameter.Resource.Annotations.OfType<InputGeneratorAnnotation>().Any()); 966Assert.True(parameter.Resource.Annotations.OfType<InputGeneratorAnnotation>().Any()); 997Assert.True(parameter.Resource.Annotations.OfType<InputGeneratorAnnotation>().Any());
ApplicationModel\Docker\WithDockerfileBuilderTests.cs (16)
25var callbackAnnotation = container.Resource.Annotations.OfType<DockerfileBuilderCallbackAnnotation>().LastOrDefault(); 49var callbackAnnotation = container.Resource.Annotations.OfType<DockerfileBuilderCallbackAnnotation>().LastOrDefault(); 68var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 89var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 141var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 177var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 211var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 252var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 288var callbackAnnotation = container.Resource.Annotations.OfType<DockerfileBuilderCallbackAnnotation>().LastOrDefault(); 309var callbackAnnotation = container.Resource.Annotations.OfType<DockerfileBuilderCallbackAnnotation>().LastOrDefault(); 331var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 367var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 399var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 433var buildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().LastOrDefault(); 469var envAnnotation = container.Resource.Annotations.OfType<EnvironmentAnnotation>().FirstOrDefault(); 471var endpointAnnotation = container.Resource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault();
ApplicationModel\McpServerEndpointAnnotationTests.cs (8)
74resource.Annotations.Add(endpointAnnotation); 89resource.Annotations.Add(endpointAnnotation); 104resource.Annotations.Add(endpointAnnotation); 120resource.Annotations.Add(endpointAnnotation); 136resource.Annotations.Add(endpointAnnotation); 151resource.Annotations.Add(endpointAnnotation); 166resource.Annotations.Add(endpointAnnotation); 183resource.Annotations.Add(endpointAnnotation);
AsHttp2ServiceTests.cs (2)
37var httpEndpoints = testProgram.ServiceABuilder.Resource.Annotations.OfType<EndpointAnnotation>().Where(sb => sb.UriScheme == "http" || sb.UriScheme == "https"); 52var endpoints = testProgram.ServiceABuilder.Resource.Annotations.OfType<EndpointAnnotation>();
AtsAnnotationTests.cs (1)
32Assert.Single(container.Resource.Annotations.OfType<AtsAnnotation>());
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (5)
581var environmentCallback = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 655var environmentCallback = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 979var annotation = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 1034var annotation = owner.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single(); 1668resource.Annotations.Add(annotation);
Backchannel\GetTerminalInfoAsyncTests.cs (1)
362target.Annotations.Add(annotation);
ComputeEnvironmentEndpointResolverTests.cs (8)
21agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(owningEnv.Resource) { ComputeEnvironment = owningEnv.Resource }); 41agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(owningEnv.Resource) { ComputeEnvironment = owningEnv.Resource }); 60agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(currentEnv.Resource) { ComputeEnvironment = currentEnv.Resource }); 117agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(currentEnv.Resource) { ComputeEnvironment = currentEnv.Resource }); 118agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(otherEnv.Resource) { ComputeEnvironment = otherEnv.Resource }); 140agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(currentEnv.Resource) { ComputeEnvironment = currentEnv.Resource }); 141agent.Resource.Annotations.Add(new DeploymentTargetAnnotation(otherEnv.Resource) { ComputeEnvironment = otherEnv.Resource }); 152resource.Annotations.Add(endpoint);
ComputeEnvironmentValidationTests.cs (1)
101resource.Annotations.Add(endpoint);
ConditionalReferenceExpressionTests.cs (5)
78resource.Annotations.Add(annotation); 127resource.Annotations.Add(annotation); 144resource.Annotations.Add(annotation); 158resource.Annotations.Add(annotation); 171resource.Annotations.Add(annotation);
ContainerRegistryResourceTests.cs (7)
316var annotation = container.Resource.Annotations.OfType<ContainerRegistryReferenceAnnotation>().SingleOrDefault(); 351var pipelineStepAnnotations = container.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 352var pipelineConfigAnnotations = container.Resource.Annotations.OfType<PipelineConfigurationAnnotation>().ToList(); 366var pipelineStepAnnotation = Assert.Single(container.Resource.Annotations.OfType<PipelineStepAnnotation>()); 390var pipelineStepAnnotations = container.Resource.Annotations.OfType<PipelineStepAnnotation>().ToList(); 690Assert.Single(container.Resource.Annotations.OfType<RegistryTargetAnnotation>()); 764Assert.Single(container.Resource.Annotations.OfType<RegistryTargetAnnotation>());
Dashboard\DashboardEventHandlersTests.cs (7)
212dashboardResource.Annotations.Add(new ProjectLaunchDefaultsAnnotation()); 219dashboardResource.Annotations.OfType<ResourceCommandAnnotation>(), 705var argsAnnotation = executableResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().Single(); 786var argsAnnotation = executableResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().Single(); 855var argsAnnotation = executableResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().Single(); 922var argsAnnotation = executableResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>().Single(); 965Assert.Empty(executableResource.Annotations.OfType<CommandLineArgsCallbackAnnotation>());
Dashboard\DashboardResourceTests.cs (3)
60var initialSnapshot = Assert.Single(dashboard.Annotations.OfType<ResourceSnapshotAnnotation>()); 61var hiddenAnnotation = Assert.Single(dashboard.Annotations.OfType<HiddenAnnotation>()); 804var annotation = Assert.Single(dashboard.Annotations.OfType<ManifestPublishingCallbackAnnotation>());
Dashboard\DashboardServiceDataTerminalTests.cs (6)
34resource.Annotations.Add(new TraitAnnotation("Owner", "Finance, Inc.")); 35resource.Annotations.Add(new TraitAnnotation("Owner", "Platform")); 36resource.Annotations.Add(new TraitAnnotation("Aspire_Dashboard_Tag", "Backend")); 172=> resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 202resource.Annotations.Add(annotation); 207resource.Annotations.Add(new DcpInstancesAnnotation([.. dcpInstances]));
Dashboard\DashboardServiceTests.cs (1)
1617resource.Annotations.Add(annotation);
Dcp\DcpExecutorTests.cs (77)
1483var tunnelEndpoint = Assert.Single(tunnelPort.Annotations.OfType<EndpointAnnotation>()); 5041var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 5044projectBuilder.Resource.Annotations.Remove(annotationToRemove); 5563var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 5566projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 5602var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 5605projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 5643var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 5646projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 5687var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 5690projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 5734var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 5737projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 6252resource.Resource.Annotations.Add( 6803var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 6806projectBuilder.Resource.Annotations.Remove(annotationToRemove); 6843var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 6846projectBuilder.Resource.Annotations.Remove(annotationToRemove); 6893var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 6896projectBuilder.Resource.Annotations.Remove(annotationToRemove); 6953var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 6956projectBuilder.Resource.Annotations.Remove(annotationToRemove); 7005var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7008projectBuilder.Resource.Annotations.Remove(annotationToRemove); 7049var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7052projectBuilder.Resource.Annotations.Remove(annotationToRemove); 7132var defaultDebugSupport = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7135projectBuilder.Resource.Annotations.Remove(defaultDebugSupport); 7139projectBuilder.Resource.Annotations.Add( 7266var defaultDebugSupport = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7269projectBuilder.Resource.Annotations.Remove(defaultDebugSupport); 7273projectBuilder.Resource.Annotations.Add( 7394var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7397projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 7481var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7484projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 7589var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7592projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 7656var defaultAnnotation = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7659projectBuilder.Resource.Annotations.Remove(defaultAnnotation); 7700var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7703projectBuilder.Resource.Annotations.Remove(annotationToRemove); 7766var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7769projectBuilder.Resource.Annotations.Remove(annotationToRemove); 7793var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7796projectBuilder.Resource.Annotations.Remove(annotationToRemove); 7840var annotationToRemove = customProject.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7843customProject.Resource.Annotations.Remove(annotationToRemove); 7890var annotationToRemove = customProject.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7893customProject.Resource.Annotations.Remove(annotationToRemove); 7936var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 7939projectBuilder.Resource.Annotations.Remove(annotationToRemove); 8018var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 8021projectBuilder.Resource.Annotations.Remove(annotationToRemove); 8281projectBuilder.Resource.Annotations.Add(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"])); 8328projectBuilder.Resource.Annotations.Add(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"])); 8365projectBuilder.Resource.Annotations.Add(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"], leadingResourceArgumentToRemove: "run")); 8401projectBuilder.Resource.Annotations.Add(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"], leadingResourceArgumentToRemove: "run")); 8436projectBuilder.Resource.Annotations.Add(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"], leadingResourceArgumentToRemove: "run")); 8481projectBuilder.Resource.Annotations.Add(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"])); 8522var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 8525projectBuilder.Resource.Annotations.Remove(annotationToRemove); 8550var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 8553projectBuilder.Resource.Annotations.Remove(annotationToRemove); 8589var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 8592projectBuilder.Resource.Annotations.Remove(annotationToRemove); 8666dotnetProject.Annotations.Add(new TestProjectWithLaunchSettings()); 10267replacement.Annotations.Add(targetEndpoint.EndpointAnnotation); 10982var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 10985projectBuilder.Resource.Annotations.Remove(annotationToRemove); 11024var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 11027projectBuilder.Resource.Annotations.Remove(annotationToRemove); 11074var annotationToRemove = projectBuilder.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().FirstOrDefault(); 11077projectBuilder.Resource.Annotations.Remove(annotationToRemove); 11174var hosts = resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 11239var host = Assert.Single(resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts); 11283var host = Assert.Single(resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts);
Dcp\DcpHostNotificationTests.cs (8)
831resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "https", name: "https")); 838resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 982resource.Annotations.Add(new HttpsCertificateConfigurationCallbackAnnotation(_ => Task.CompletedTask)); 1033resource.Annotations.Add(new HttpsCertificateConfigurationCallbackAnnotation(_ => Task.CompletedTask)); 1035resource.Annotations.Add(new HttpsCertificateAnnotation 1081resource.Annotations.Add(new HttpsCertificateAnnotation 1126resource.Annotations.Add(new HttpsCertificateConfigurationCallbackAnnotation(_ => Task.CompletedTask)); 1127resource.Annotations.Add(new HttpsCertificateAnnotation
Dcp\ExecutableLaunchPlanTests.cs (11)
21resource.Annotations.Add(new LaunchToolArgsCallbackAnnotation( 25resource.Annotations.Add(SupportsDebuggingAnnotation.Create( 68resource.Annotations.Add(new LaunchToolArgsCallbackAnnotation( 72resource.Annotations.Add(SupportsDebuggingAnnotation.Create( 101resource.Annotations.Add(SupportsDebuggingAnnotation.Create( 133resource.Annotations.Add(new TestProjectMetadata(projectPath)); 157resource.Annotations.Add(new TestProjectMetadata("/tmp/project.csproj")); 158resource.Annotations.Add(new LaunchToolArgsCallbackAnnotation( 162resource.Annotations.Add(SupportsDebuggingAnnotation.Create( 186resource.Annotations.Add(new ForceProcessExecutionAnnotation()); 283resource.Annotations.Add(new ExecutableLaunchRecipeAnnotation(DirectExecutableLaunchRecipe.Instance));
Dcp\ResourceSnapshotBuilderTests.cs (28)
65project.Annotations.Add(new TestProjectMetadata()); 66project.Annotations.Add(new LaunchProfileAnnotation("https")); 95project.Resource.Annotations.Add(new TestProjectMetadata()); 123project.Resource.Annotations.Add(new TestProjectMetadata()); 167resource.Annotations.Add(new TestProjectMetadata 173resource.Annotations.Add(SupportsDebuggingAnnotation.Create<object>( 220resource.Annotations.Add(new TestProjectMetadata 226resource.Annotations.Add(new ProjectLaunchDefaultsAnnotation { BuildConfiguration = configuration }); 227resource.Annotations.Add(SupportsDebuggingAnnotation.Create<object>( 274resource.Annotations.Add(new TestProjectMetadata 280resource.Annotations.Add(SupportsDebuggingAnnotation.Create<object>( 318project.Annotations.Add(new TestProjectMetadata()); 368project.Annotations.Add(new TestProjectMetadata()); 411project.Annotations.Add(new TestProjectMetadata()); 464project.Annotations.Add(new TestProjectMetadata()); 493project.Annotations.Add(new TestProjectMetadata()); 525project.Annotations.Add(new TestProjectMetadata()); 549project.Annotations.Add(new TestProjectMetadata()); 572project.Annotations.Add(new TestProjectMetadata()); 597resource.Annotations.Add(SupportsDebuggingAnnotation.Create<object>( 613resource.Annotations.Add(new ForceProcessExecutionAnnotation()); 618resource.Annotations.Remove(resource.Annotations.OfType<ForceProcessExecutionAnnotation>().Single()); 619resource.Annotations.Add(new ContainerLifetimeAnnotation 631project.Annotations.Add(new TestProjectMetadata()); 632project.Annotations.Add(new OverrideTestProjectMetadata()); 659resource.Annotations.Add(new TestProjectMetadata()); 660resource.Annotations.Add(new LaunchProfileAnnotation("https"));
DebugSupportExtensionsTests.cs (1)
143var debugSupport = Assert.Single(project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>());
DistributedApplicationBuilderTests.cs (2)
1399resource.Annotations.Add(NameValidationPolicyAnnotation.None); 1425resource.Annotations.Add(NameValidationPolicyAnnotation.None);
DistributedApplicationModelExtensionsTests.cs (2)
52containerWithDockerfile.Resource.Annotations.Add(new DockerfileBuildAnnotation("/context", "/Dockerfile", null)); 56buildOnlyContainer.Resource.Annotations.Add(new DockerfileBuildAnnotation("/context", "/Dockerfile", null) { HasEntrypoint = false });
DistributedApplicationTests.cs (1)
2416var hasMultipleEndpoints = redis.Annotations.OfType<EndpointAnnotation>().Count() > 1;
DotnetProgramPublishingTests.cs (14)
35Assert.Single(resource.Annotations.OfType<DotnetProgramPublishingAnnotation>()); 36Assert.Single(resource.Annotations.OfType<PipelineStepAnnotation>()); 37Assert.Single(resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 38Assert.Single(resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>()); 53resource.Resource.Annotations.OfType<DotnetProgramBuildEnvironmentCallbackAnnotation>(), 69Assert.Empty(resource.Resource.Annotations.OfType<DotnetProgramBuildEnvironmentCallbackAnnotation>()); 118Assert.Single(resource.Resource.Annotations.OfType<DotnetProgramPublishingAnnotation>()); 119Assert.Single(resource.Resource.Annotations.OfType<PipelineStepAnnotation>()); 120Assert.Single(resource.Resource.Annotations.OfType<PipelineConfigurationAnnotation>()); 121Assert.Single(resource.Resource.Annotations.OfType<ContainerBuildOptionsCallbackAnnotation>()); 128resource.Annotations.Add(new TestProjectMetadata("first.csproj")); 129resource.Annotations.Add(new TestProjectMetadata("second.csproj")); 222var annotation = Assert.Single(resource.Resource.Annotations.OfType<PipelineStepAnnotation>()); 291resource.Annotations.Add(new ReplicaAnnotation(3));
EndpointReferenceTests.cs (23)
17resource.Annotations.Add(annotation); 35resource.Annotations.Add(annotation); 54resource.Annotations.Add(annotation); 69resource.Annotations.Add(annotation); 88resource.Annotations.Add(annotation); 107resource.Annotations.Add(annotation); 121resource.Annotations.Add(annotation); 135resource.Annotations.Add(annotation); 149resource.Annotations.Add(annotation); 168resource.Annotations.Add(annotation); 186resource.Annotations.Add(annotation); 217resource.Annotations.Add(annotation); 230resource.Annotations.Add(annotation); 243resource.Annotations.Add(annotation); 256resource.Annotations.Add(annotation); 269resource.Annotations.Add(annotation); 282resource.Annotations.Add(annotation); 371resource.Annotations.Add(new ContainerImageAnnotation { Image = "test-image" }); 386resource.Annotations.Add(annotation); 416resource.Annotations.Add(httpEndpoint); 431resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http")); 432resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "tcp", name: "grpc")); 459resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, uriScheme: "http", name: "http"));
ExecutableResourceBuilderExtensionTests.cs (10)
30var annotation = executable.Resource.Annotations.OfType<ExecutableAnnotation>().Single(); 42var annotation = executable.Resource.Annotations.OfType<ExecutableAnnotation>().Single(); 57var annotation = executable.Resource.Annotations.OfType<ExecutableAnnotation>().Single(); 79var annotation = executable.Resource.Annotations.OfType<ExecutableAnnotation>().Single(); 101var annotation = executable.Resource.Annotations.OfType<PersistenceAnnotation>().Single(); 113var annotation = executable.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 134var annotation = executable.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 339var annotations = executable.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().ToList(); 360var annotation = executable.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().Single(); 376Assert.Empty(executable.Resource.Annotations.OfType<SupportsDebuggingAnnotation>());
ExpressionResolverTests.cs (1)
336var endpointAnnotation = dependency.Resource.Annotations.OfType<EndpointAnnotation>().Single();
KestrelConfigTests.cs (5)
25resource.Annotations.OfType<EndpointAnnotation>(), 62resource.Annotations.OfType<EndpointAnnotation>(), 94resource.Annotations.OfType<EndpointAnnotation>(), 111resource.Annotations.OfType<EndpointAnnotation>(), 457foreach (var endpoint in resource.Annotations.OfType<EndpointAnnotation>())
Orchestrator\ApplicationOrchestratorTests.cs (4)
711waiter.Resource.Annotations.Add(new DcpInstancesAnnotation([ 771waiter.Resource.Annotations.Add(new DcpInstancesAnnotation([ 820waiter.Resource.Annotations.Add(new DcpInstancesAnnotation([ 873waiter.Resource.Annotations.Add(new DcpInstancesAnnotation([
Orchestrator\ParameterProcessorTests.cs (12)
1036var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1056var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1087var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1112var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1146var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1184var deleteCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1216var deleteCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1244var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1312parameter.Annotations.Add(new InputGeneratorAnnotation(_ => new InteractionInput 1344regionParameter.Annotations.Add(new InputGeneratorAnnotation(_ => new InteractionInput 1351zoneParameter.Annotations.Add(new InputGeneratorAnnotation(_ => new InteractionInput 1389parameter.Annotations.Add(new InputGeneratorAnnotation(_ => new InteractionInput
Orchestrator\RelationshipEvaluatorTests.cs (1)
26Assert.Collection(manager.Resource.Annotations.OfType<ResourceRelationshipAnnotation>(),
PersistentContainerWarningTests.cs (2)
29container.Annotations.Add(new PersistenceAnnotation { Mode = PersistenceMode.Persistent }); 53container.Annotations.Add(new PersistenceAnnotation { Mode = PersistenceMode.Persistent });
ProjectRebuilderResourceTests.cs (2)
24var launchDefaults = Assert.Single(project.Resource.Annotations.OfType<ProjectLaunchDefaultsAnnotation>()); 62var launchDefaults = Assert.Single(project.Resource.Annotations.OfType<ProjectLaunchDefaultsAnnotation>());
ProjectResourceBuilderExtensionTests.cs (2)
53var annotation = project.Resource.Annotations.OfType<PersistenceAnnotation>().Single(); 107Assert.Single(project.Resource.Annotations.OfType<ProjectLaunchDefaultsAnnotation>());
ProjectResourceTests.cs (15)
135var serviceMetadata = Assert.Single(resource.Annotations.OfType<IProjectMetadata>()); 244Assert.Equal(expectedOtlpExporter, resource.Annotations.OfType<OtlpExporterAnnotation>().Any()); 296var replica = Assert.Single(resource.Annotations.OfType<ReplicaAnnotation>()); 314Assert.Contains(resource.Annotations, a => a is LaunchProfileAnnotation); 332resource.Annotations.OfType<EndpointAnnotation>(), 381Assert.Contains(resource.Annotations, a => a is ExcludeLaunchProfileAnnotation); 583Assert.Contains(resource.Annotations, a => a is DisableForwardedHeadersAnnotation); 860var pipelineStepAnnotation = Assert.Single(resource.Annotations.OfType<PipelineStepAnnotation>()); 904var containerFilesAnnotation = Assert.Single(resource.Annotations.OfType<ContainerFilesDestinationAnnotation>()); 908Assert.Single(resource.Annotations.OfType<PipelineStepAnnotation>()); 1009var annotation = project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 1020var annotation = project.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 1081var annotation = app.Resource.Annotations.OfType<SupportsDebuggingAnnotation>().SingleOrDefault(); 1136resource.Annotations.Add(new TestProject()); 1137resource.Annotations.Add(new OverrideTestProject());
PublishAsDockerfileTests.cs (4)
284Assert.Empty(container.Annotations.OfType<EndpointAnnotation>()); 303var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 329var endpoint = Assert.Single(container.Annotations.OfType<EndpointAnnotation>()); 351var endpoints = container.Annotations.OfType<EndpointAnnotation>().OrderBy(e => e.Name).ToList();
Publishing\ResourceContainerImageManagerTests.cs (2)
1581var annotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single(); 1791var dockerfileBuildAnnotation = container.Resource.Annotations.OfType<DockerfileBuildAnnotation>().Single();
RequiredCommandAnnotationTests.cs (4)
63var annotation = resourceBuilder.Resource.Annotations.OfType<RequiredCommandAnnotation>().Single(); 77var annotation = resourceBuilder.Resource.Annotations.OfType<RequiredCommandAnnotation>().Single(); 93var annotation = resourceBuilder.Resource.Annotations.OfType<RequiredCommandAnnotation>().Single(); 109var annotations = resourceBuilder.Resource.Annotations.OfType<RequiredCommandAnnotation>().ToList();
ResourceBuilderLifetimeTests.cs (5)
23var annotation = container.Resource.Annotations.OfType<PersistenceAnnotation>().Single(); 49var annotation = container.Resource.Annotations.OfType<PersistenceAnnotation>().Single(); 65var annotation = Assert.Single(container.Resource.Annotations.OfType<PersistenceAnnotation>()); 83var annotation = Assert.Single(container.Resource.Annotations.OfType<PersistenceAnnotation>()); 166var annotation = container.Resource.Annotations.OfType<PersistenceAnnotation>().Single();
ResourceCommandAnnotationTests.cs (9)
62var startCommand = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == commandName); 89var restartCommand = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 104var restartCommand = projectResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 119var restartCommand = csharpAppResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 143var rebuildCommand = projectResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == commandName); 170Assert.DoesNotContain(containerResource.Resource.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == KnownResourceCommands.RebuildCommand); 171Assert.Contains(projectResource.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == KnownResourceCommands.RebuildCommand); 180var rebuildCommand = projectResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RebuildCommand); 197projectResource.Annotations.Add(new ProjectLaunchDefaultsAnnotation());
ResourceDependencyTests.cs (1)
267var annotation = executable.Resource.Annotations.OfType<EnvironmentCallbackAnnotation>().Single();
ResourceExtensionsTests.cs (13)
24resource.Annotations.Add(new TestProjectMetadata()); 357var annotation = Assert.Single(containerResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 404var annotations = containerResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>().ToList(); 434Assert.Single(containerResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 440Assert.Single(projectResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 444Assert.Single(executableResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 461var annotation = Assert.Single(containerResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 488var annotation = Assert.Single(containerResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 500var annotation = Assert.Single(containerResource.Resource.Annotations.OfType<ContainerImagePushOptionsCallbackAnnotation>()); 512Assert.Collection(resource.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>(), 520var annotation = Assert.Single(resource.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>()); 524Assert.Collection(resource.Resource.Annotations.OfType<ContainerFilesSourceAnnotation>(), 542var annotation = Assert.Single(resource.Resource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>());
ResourceLoggerServiceTests.cs (2)
220testResource.Annotations.Add(new DcpInstancesAnnotation([new DcpInstance("instance0", "0", 0), new DcpInstance("instance1", "1", 1)])); 261testResource.Annotations.Add(new DcpInstancesAnnotation([new DcpInstance("instance0", "0", 0), new DcpInstance("instance1", "1", 1)]));
ResourceNotificationTests.cs (29)
37var annotation = custom.Resource.Annotations.OfType<ResourceSnapshotAnnotation>().SingleOrDefault(); 409resource.Annotations.Add(new WaitAnnotation(dependency1, WaitType.WaitUntilStarted)); 410resource.Annotations.Add(new WaitAnnotation(dependency2, WaitType.WaitUntilStarted)); 453dependency1.Annotations.Add(new HealthCheckAnnotation("dependency1-health")); 455dependency2.Annotations.Add(new HealthCheckAnnotation("dependency2-health")); 457resource.Annotations.Add(new WaitAnnotation(dependency1, WaitType.WaitUntilHealthy)); 458resource.Annotations.Add(new WaitAnnotation(dependency2, WaitType.WaitUntilHealthy)); 513resource.Annotations.Add(new WaitAnnotation(dependency1, WaitType.WaitForCompletion)); 514resource.Annotations.Add(new WaitAnnotation(dependency2, WaitType.WaitForCompletion)); 563resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 606resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 634resource.Annotations.Add(new ExplicitStartupAnnotation()); 635resource.Annotations.Add(new DcpInstancesAnnotation([ 639resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 679resource.Annotations.Add(new ExplicitStartupAnnotation()); 680resource.Annotations.Add(new DcpInstancesAnnotation([new DcpInstance("resource-abc123", "abc123", 0)])); 681resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 713resource.Annotations.Add(new ExplicitStartupAnnotation()); 714resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 749resource.Annotations.Add(new DcpInstancesAnnotation([ 753resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 784dependency.Annotations.Add(new DcpInstancesAnnotation([ 790resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 889resource.Annotations.Add(new WaitAnnotation(dependency, WaitType.WaitUntilStarted)); 1079resource.Annotations.Add(new ResourceIconAnnotation("FirstIcon", IconVariant.Filled)); 1080resource.Annotations.Add(new ResourceIconAnnotation("LastIcon", IconVariant.Regular)); 1139resource.Annotations.Add(new ResourceIconAnnotation("FirstIcon", IconVariant.Filled)); 1140resource.Annotations.Add(new ResourceIconAnnotation("LastIcon", IconVariant.Regular)); 1176resource.Annotations.Add(new ResourceIconAnnotation("AnnotationIcon", IconVariant.Regular));
ResourceTraitBuilderTests.cs (3)
29resource.Resource.Annotations.OfType<TraitAnnotation>().Select(t => (t.Name, t.Value))); 71resource.Resource.Annotations.OfType<TraitAnnotation>().Select(t => (t.Name, t.Value))); 86resource.Resource.Annotations.OfType<TraitAnnotation>().Select(t => t.Value));
ResourceWithProbeTests.cs (3)
17var annotations = resource.Resource.Annotations.OfType<ProbeAnnotation>().ToArray(); 31var annotations = resource.Resource.Annotations.OfType<ProbeAnnotation>().ToArray(); 51var annotations = resource.Resource.Annotations.OfType<ProbeAnnotation>().ToArray();
SlimTestProgramTests.cs (2)
59var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 78var endpoint = projectBuilders.Resource.Annotations.OfType<EndpointAnnotation>().Single();
Utils\WithAnnotationTests.cs (4)
17var dummyAnnotations = redis.Resource.Annotations.OfType<DummyAnnotation>(); 31var dummyAnnotations = redis.Resource.Annotations.OfType<DummyAnnotation>(); 43var firstAnnotation = redis.Resource.Annotations.OfType<DummyAnnotation>().Single(); 47var secondAnnotation = redis.Resource.Annotations.OfType<DummyAnnotation>().Single();
WithEndpointTests.cs (15)
149var endpoint = Assert.Single(container.Resource.Annotations.OfType<EndpointAnnotation>()); 162var endpoint = Assert.Single(container.Resource.Annotations.OfType<EndpointAnnotation>()); 197var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>() 213var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>() 239var endpoints = resource.Annotations.OfType<EndpointAnnotation>().ToArray(); 658var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 674var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 690var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 707var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 724var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 742var envAnnotations = resource.Annotations.OfType<EnvironmentCallbackAnnotation>().ToList(); 780var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "api"); 798var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 815var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http"); 832var endpoint = Assert.Single(resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "http");
WithHttpCommandTests.cs (6)
205var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().FirstOrDefault(); 238var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().FirstOrDefault(); 279var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 315var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 414var commands = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 1082var endpointAnnotation = service.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithIconNameTests.cs (6)
20var iconAnnotation = container.Resource.Annotations.OfType<ResourceIconAnnotation>().Single(); 34var iconAnnotation = container.Resource.Annotations.OfType<ResourceIconAnnotation>().Single(); 78Assert.Single(container.Resource.Annotations.OfType<ResourceIconAnnotation>()); 79Assert.Single(parameter.Resource.Annotations.OfType<ResourceIconAnnotation>()); 80Assert.Single(project.Resource.Annotations.OfType<ResourceIconAnnotation>()); 93var iconAnnotations = container.Resource.Annotations.OfType<ResourceIconAnnotation>().ToList();
WithMcpServerTests.cs (6)
35var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 57var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 82var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 107var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 132var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>()); 157var mcpAnnotation = Assert.Single(resource.Annotations.OfType<McpServerEndpointAnnotation>());
WithOtlpExporterTests.cs (12)
97var annotation = Assert.Single(container.Resource.Annotations.OfType<OtlpExporterAnnotation>()); 158dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: endpointName, uriScheme: "http", port: 18889, isProxied: true, transport: transport)); 174var annotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == endpointName); 195dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 196dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpHttpEndpointName, uriScheme: "http", port: 18890, isProxied: true)); 204var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 207var httpAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName); 250dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 259var grpcAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 280dashboard.Resource.Annotations.Add(new EndpointAnnotation(ProtocolType.Tcp, name: KnownEndpointNames.OtlpGrpcEndpointName, uriScheme: "http", port: 18889, isProxied: true, transport: "http2")); 316var dashboardAnnotation = dashboard.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 319var collectorAnnotation = collector.Resource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "otlp-grpc");
WithProcessCommandTests.cs (3)
71var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 111var command = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 251var command = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single();
WithReferenceTests.cs (2)
239var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single(); 252var endpoint = container.Resource.Annotations.OfType<EndpointAnnotation>().Single();
WithTerminalTests.cs (28)
86var annotation = resource.Resource.Annotations.OfType<TerminalAnnotation>().SingleOrDefault(); 160var annotation = resource.Resource.Annotations.OfType<TerminalAnnotation>().SingleOrDefault(); 243var annotation = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single(); 258var waitAnnotations = resource.Resource.Annotations.OfType<WaitAnnotation>() 284var annotation = container.Resource.Annotations.OfType<TerminalAnnotation>().SingleOrDefault(); 310var manifestAnnotation = host.Annotations.OfType<ManifestPublishingCallbackAnnotation>().SingleOrDefault(); 330var snapshot = host.Annotations.OfType<ResourceSnapshotAnnotation>().Single(); 358var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 363Assert.True(host.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot.IsHidden); 364Assert.Single(host.Annotations.OfType<OtlpExporterAnnotation>()); 413var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 418Assert.True(host.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot.IsHidden); 419Assert.Empty(host.Annotations.OfType<OtlpExporterAnnotation>()); 450.Select(resource => resource.Resource.Annotations.OfType<TerminalAnnotation>().Single()) 527var annotation = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single(); 1083Assert.False(resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().IsInitialized); 1158var annotation = resource.Resource.Annotations.OfType<TerminalAnnotation>().FirstOrDefault(); 1217var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 1236var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 1266var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 1287var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 1316firstResource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts).Layout.ReplicaId; 1322secondResource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts).Layout.ReplicaId; 1334resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts); 1364var hosts = resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts; 1404foreach (var host in resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts) 1413foreach (var callbackAnnotation in host.Annotations.OfType<CommandLineArgsCallbackAnnotation>()) 1478var host = Assert.Single(resource.Resource.Annotations.OfType<TerminalAnnotation>().Single().TerminalHosts);
WithVolumeTests.cs (2)
42var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>()); 70var mount = Assert.Single(container.Resource.Annotations.OfType<ContainerMountAnnotation>());
Aspire.Hosting.Valkey.Tests (10)
AddValkeyTests.cs (6)
27var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 36var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 55var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>()); 64var containerAnnotation = Assert.Single(containerResource.Annotations.OfType<ContainerImageAnnotation>()); 210var volumeAnnotation = valkey.Resource.Annotations.OfType<ContainerMountAnnotation>().Single(); 235var volumeAnnotation = valkey.Resource.Annotations.OfType<ContainerMountAnnotation>().Single();
tests\Shared\ContainerReplCommandTestBase.cs (4)
29var commands = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 51var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 81var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>()); 104var command = Assert.Single(resource.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.Yarp (1)
YarpResource.cs (1)
26Annotations.Add(new PipelineConfigurationAnnotation(context =>
Aspire.Hosting.Yarp.Tests (14)
AddYarpTests.cs (14)
27Assert.Collection(resource.Annotations.OfType<EndpointAnnotation>(), 202var annotation = Assert.Single(yarp.Resource.Annotations.OfType<ContainerFileSystemCallbackAnnotation>()); 214var annotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 227var annotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 260Assert.Empty(yarp.Resource.Annotations.OfType<ContainerFilesDestinationAnnotation>()); 261Assert.Empty(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 278var containerFilesAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<ContainerFilesDestinationAnnotation>()); 288Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 305var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 335var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 368var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 406var buildAnnotation = Assert.Single(yarp.Resource.Annotations.OfType<DockerfileBuildAnnotation>()); 446var httpsEndpoint = Assert.Single(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 471Assert.DoesNotContain(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https");
DotnetTool.AppHost (2)
AppHost.cs (2)
49foreach(var toolAnnotation in substituted.Resource.Annotations.OfType<DotnetToolAnnotation>().ToList()) 51substituted.Resource.Annotations.Remove(toolAnnotation);
Publishers.AppHost (1)
DistributedApplicationBuilderExtensions.cs (1)
20Annotations.Add(new PipelineStepAnnotation(context =>