3 types derived from PeerProbeResult
aspire (2)
Acquisition\IPeerInstallProbe.cs (2)
13public sealed record Ok(InstallationInfo Info) : PeerProbeResult; 16public sealed record Failed(string Reason) : PeerProbeResult;
Aspire.Cli.Tests (1)
TestServices\UnknownPeerProbeResult.cs (1)
8internal sealed record UnknownPeerProbeResult : PeerProbeResult;
70 references to PeerProbeResult
aspire (12)
Acquisition\InstallationDiscovery.cs (3)
227var probe = await _peerProbe.ProbeAsync(canonical, cancellationToken).ConfigureAwait(false); 230case PeerProbeResult.Ok ok: 271case PeerProbeResult.Failed failed:
Acquisition\IPeerInstallProbe.cs (1)
38Task<PeerProbeResult> ProbeAsync(string binaryPath, CancellationToken cancellationToken);
Acquisition\PeerInstallProbe.cs (8)
67public async Task<PeerProbeResult> ProbeAsync(string binaryPath, CancellationToken cancellationToken) 71return new PeerProbeResult.Failed("Binary not found."); 89return new PeerProbeResult.Failed(primaryFailure); 94return new PeerProbeResult.Ok(primaryInfo); 117return new PeerProbeResult.Failed(DescribePrimaryFailure(primary, alsoTriedVersion: true)); 122return new PeerProbeResult.Failed(DescribePrimaryFailure(primary, alsoTriedVersion: true)); 128return new PeerProbeResult.Failed(DescribePrimaryFailure(primary, alsoTriedVersion: true)); 136return new PeerProbeResult.Ok(new InstallationInfo
Aspire.Cli.Tests (58)
Acquisition\InstallationDiscoveryDiscoverAllTests.cs (29)
133var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 135[binary] = new PeerProbeResult.Ok(new InstallationInfo 174var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 176[firstPathBinary] = new PeerProbeResult.Ok(new InstallationInfo 182[secondPathBinary] = new PeerProbeResult.Ok(new InstallationInfo 188[offPathBinary] = new PeerProbeResult.Ok(new InstallationInfo 222var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 224[binary] = new PeerProbeResult.Ok(new InstallationInfo 253var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 255[binary] = new PeerProbeResult.Failed("simulated probe failure"), 281var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 283[binary] = new PeerProbeResult.Failed("simulated peer hang"), 305var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 331var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 333[binary] = new PeerProbeResult.Failed("peer returned malformed JSON"), 371var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 374[binary] = new PeerProbeResult.Ok(new InstallationInfo 405var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 407[binary] = new PeerProbeResult.Ok(new InstallationInfo 440var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 444[binary] = new PeerProbeResult.Ok(new InstallationInfo 476var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 478[binary] = new PeerProbeResult.Ok(new InstallationInfo 767var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 769[binary] = new PeerProbeResult.Ok(new InstallationInfo 797var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 799[binary] = new PeerProbeResult.Ok(new InstallationInfo 864var probe = new FakePeerInstallProbe(new Dictionary<string, PeerProbeResult> 869[binary] = new PeerProbeResult.Ok(new InstallationInfo
Acquisition\PeerInstallProbeTests.cs (22)
34private static PeerProbeResult.Ok AssertProbeOk(PeerProbeResult result) 36if (result is PeerProbeResult.Failed failed) 41return Assert.IsType<PeerProbeResult.Ok>(result); 70var result = await probe.ProbeAsync(missing, TestContext.Current.CancellationToken); 72Assert.IsType<PeerProbeResult.Failed>(result); 88var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 121var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 147var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 171var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 260var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 283var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 285var failed = Assert.IsType<PeerProbeResult.Failed>(result); 303var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 305Assert.IsType<PeerProbeResult.Failed>(result); 322var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 350var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 368var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 371var failed = Assert.IsType<PeerProbeResult.Failed>(result); 408private async Task<PeerProbeResult.Failed> ProbeFakeFailureAsync(FakeScriptResult fakePeer) 423var result = await probe.ProbeAsync(fakePeer.Path, TestContext.Current.CancellationToken); 424return Assert.IsType<PeerProbeResult.Failed>(result);
TestServices\FakePeerInstallProbe.cs (7)
16private readonly Dictionary<string, PeerProbeResult> _responses; 21public FakePeerInstallProbe(IDictionary<string, PeerProbeResult>? responses = null) 24_responses = new Dictionary<string, PeerProbeResult>(_pathComparer); 48public Task<PeerProbeResult> ProbeAsync(string binaryPath, CancellationToken cancellationToken) 54var result = _responses.TryGetValue(binaryPath, out var value) 56: new PeerProbeResult.Failed("No response configured.");