43 references to Code
Aspire.Hosting.Native.Core.Tests (42)
NativeBuilderAuthoringTests.cs (1)
255Assert.Equal("HANDLE_NOT_FOUND", failure.Code);
NativeCSharpClientTests.cs (4)
93Assert.Equal("HANDLE_NOT_FOUND", error.Code); 112Assert.Equal("OPERATION_REJECTED", completed.Code); 132Assert.Equal("NOT_SUPPORTED", error.Code); 237Assert.Equal("HANDLE_NOT_FOUND", error.Code);
NativeProviderClientTests.cs (8)
36Assert.Equal("HANDLE_NOT_FOUND", stale.Code); 180Assert.Equal("HANDLE_NOT_FOUND", unauthorized.Code); 183Assert.Equal("HANDLE_NOT_FOUND", retired.Code); 232Assert.Equal("INVALID_HANDLE", failure.Code); 325Assert.Equal("INVALID_ARGUMENT", failure.Code); 442Assert.Equal("PROVIDER_TIMEOUT", error.Code); 447Assert.Equal("UNKNOWN_CAPABILITY", unavailable.Code); 466Assert.Equal("PROVIDER_DISCONNECTED", error.Code);
NativeProviderLifecycleTests.cs (9)
296expired.ReadLifecyclePhaseAsync())).Code); 298Assert.Equal("HANDLE_NOT_FOUND", revoked?.Code); 346Assert.Equal("HANDLE_NOT_FOUND", (await Assert.ThrowsAsync<NativeCapabilityException>(() => scope.ReadLifecyclePhaseAsync())).Code); 418Assert.True(retirementFailure is null or NativeCapabilityException { Code: "PROVIDER_DISCONNECTED" }); 441Assert.Equal("PROVIDER_LIFECYCLE_FAILED", failure.Code); 477Assert.Equal("PROVIDER_LIFECYCLE_TIMEOUT", (await Assert.ThrowsAsync<NativeCapabilityException>(() => ready)).Code); 528Assert.Equal("HANDLE_NOT_FOUND", forged.Code); 542Assert.Equal("OPERATION_REJECTED", foreign.Code); 554Assert.Equal("LIFECYCLE_AUTHORITY_REQUIRED", rejected.Code);
NativeRpcAuthoringTests.cs (13)
61environmentEditor.SetAsync("STALE", "must-not-apply"))).Code); 76source.GetResourceNameAsync())).Code); 100builder.BuildAsync())).Code); 107Assert.Equal("PROVIDER_FAILED", failure.Code); 111retained.SetAsync("STALE", "value"))).Code); 139Assert.Equal("HANDLE_NOT_FOUND", (await Assert.ThrowsAsync<NativeCapabilityException>(() => editing)).Code); 171retained.AddAsync("late"))).Code); 192resource.WithEnvironmentAsync("PASSWORD", otherValue))).Code); 202client.InvokeAsync("Aspire.Hosting.Native.Authoring/withEnvironment", arguments, TestContext.Current.CancellationToken))).Code); 205client.InvokeAsync("Aspire.Hosting.Native.Authoring/withEnvironment", arguments, TestContext.Current.CancellationToken))).Code); 236Assert.Equal("INVALID_ARGUMENT", failure.Code); 239retained.SetAsync("STALE", "must-not-apply"))).Code); 283retained.SetAsync("STALE", "must-not-apply"))).Code);
NativeSymbolicValueClientTests.cs (5)
38Assert.Equal("INVALID_ARGUMENT", mismatch.Code); 43Assert.Equal("HANDLE_NOT_FOUND", retired.Code); 75Assert.Equal("VALUE_REVISION_STALE", stale.Code); 77Assert.Equal("HANDLE_NOT_FOUND", revoked.Code); 99Assert.Equal("VALUE_NETWORK_CONTEXT_UNSUPPORTED", error.Code);
NativeSymbolicWorkloadSocketTests.cs (2)
80Assert.Equal("VALUE_REVISION_STALE", stale.Code); 82Assert.Equal("HANDLE_NOT_FOUND", revoked.Code);
NativeIntegrations.Redis.Validation (1)
RedisPersistenceValidation.cs (1)
24catch (NativeCapabilityException exception) when (exception.Code == "INVALID_ARGUMENT")