1 instantiation of DevTunnelPortResource
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
579var portResource = new DevTunnelPortResource(
54 references to DevTunnelPortResource
Aspire.Hosting.DevTunnels (26)
DevTunnelHealthCheck.cs (2)
34foreach (var portResource in _tunnelResource.Ports) 50foreach (var portResource in _tunnelResource.Ports)
DevTunnelPortHealthCheck.cs (2)
9internal sealed class DevTunnelPortHealthCheck(DevTunnelPortResource portResource) : IHealthCheck 11private readonly DevTunnelPortResource _portResource = portResource ?? throw new ArgumentNullException(nameof(portResource));
DevTunnelResource.cs (2)
37internal List<DevTunnelPortResource> Ports { get; } = []; 61/// Initializes a new instance of the <see cref="DevTunnelPortResource"/> class, representing a single forwarded endpoint/port on a dev tunnel.
DevTunnelResourceBuilderExtensions.cs (20)
155foreach (var portResource in tunnelResource.Ports) 187async Task StartPortAsync(DevTunnelPortResource portResource) 409var portResource = tunnelBuilder.Resource.Ports 432var portResource = tunnelBuilder.Resource.Ports 491foreach (var port in tunnelResource.Resource.Ports.Where(p => p.TargetEndpoint.Resource == targetResource.Resource)) 579var portResource = new DevTunnelPortResource( 607DevTunnelPortResource.ShowTunnelUrlsCommandName, 637if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 645if (urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 658var portResource = (DevTunnelPortResource)context.Resource; 739: string.Equals(u.Name, DevTunnelPortResource.TunnelEndpointName, StringComparisons.EndpointAnnotationName) 798private static async Task<ExecuteCommandResult> ShowTunnelUrlsAsync(DevTunnelPortResource portResource, ExecuteCommandContext context) 833private static List<ResourcePropertySnapshot> GetUrlProperties(DevTunnelPortResource portResource) 842new(DevTunnelPortResource.TunnelUrlPropertyName, NormalizeUrl(portUri)) 851properties.Add(new(DevTunnelPortResource.InspectUrlPropertyName, inspectUrl) 860properties.Add(new(DevTunnelPortResource.LocalEndpointUrlPropertyName, localUrl) 882name is DevTunnelPortResource.TunnelUrlPropertyName 883or DevTunnelPortResource.InspectUrlPropertyName 884or DevTunnelPortResource.LocalEndpointUrlPropertyName;
Aspire.Hosting.DevTunnels.Tests (26)
DevTunnelResourceBuilderExtensionsTests.cs (26)
33var tunnelPort = tunnel.Resource.Ports.FirstOrDefault(); 98var port = tunnel.Resource.Ports.First(); 112var tunnelPort = Assert.Single(tunnel.Resource.Ports); 127var tunnelPort = Assert.Single(tunnel.Resource.Ports); 146var tunnelPort = Assert.Single(tunnel.Resource.Ports); 166var tunnelPort = Assert.Single(tunnel.Resource.Ports); 216var tunnelPort = Assert.Single(tunnel.Resource.Ports); 289Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 306Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 324Assert.Equal(DevTunnelPortResource.TunnelEndpointName, tunnelEndpoint.EndpointName); 402Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpTunnelEndpoint.EndpointName); 403Assert.Equal(DevTunnelPortResource.TunnelEndpointName, httpsTunnelEndpoint.EndpointName); 420var port = Assert.Single(tunnel.Resource.Ports); 428var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 510var port = Assert.Single(tunnel.Resource.Ports); 516var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 558var port = Assert.Single(tunnel.Resource.Ports); 564var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 618var tunnelPort = Assert.Single(tunnel.Resource.Ports); 652var port = Assert.Single(tunnel.Resource.Ports); 668DevTunnelPortResource.TunnelUrlPropertyName or 669DevTunnelPortResource.InspectUrlPropertyName or 670DevTunnelPortResource.LocalEndpointUrlPropertyName), 673Assert.Equal(DevTunnelPortResource.TunnelUrlPropertyName, property.Name); 680Assert.Equal(DevTunnelPortResource.InspectUrlPropertyName, property.Name); 687Assert.Equal(DevTunnelPortResource.LocalEndpointUrlPropertyName, property.Name);
Aspire.Hosting.Tests (2)
Dcp\DcpExecutorTests.cs (2)
1077var tunnelPort = Assert.Single(distributedAppModel.Resources.OfType<DevTunnelPortResource>());