2 instantiations of OptionsValidationException
Microsoft.Extensions.Options (1)
OptionsFactory.cs (1)
87
throw new
OptionsValidationException
(name, typeof(TOptions), failures);
Microsoft.Extensions.Options.Contextual (1)
Internal\ContextualOptionsFactory.cs (1)
146
throw new
OptionsValidationException
(name, typeof(TOptions), failures);
25 references to OptionsValidationException
Aspire.Hosting.Tests (2)
HealthCheckTests.cs (2)
117
var
ex = await Assert.ThrowsAsync<
OptionsValidationException
>(async () =>
Microsoft.AspNetCore.Authentication.Test (1)
CookieTests.cs (1)
293
Assert.Throws<
OptionsValidationException
>(() => options.Get(CookieAuthenticationDefaults.AuthenticationScheme));
Microsoft.AspNetCore.HeaderParsing.Tests (2)
HeaderParsingExtensionsTests.cs (2)
37
Assert.Throws<
OptionsValidationException
>(() => services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value);
47
Assert.Throws<
OptionsValidationException
>(() => services.GetRequiredService<IOptions<HeaderParsingOptions>>().Value);
Microsoft.AspNetCore.HttpOverrides.Tests (2)
CertificateForwardingTest.cs (2)
24
Assert.Throws<
OptionsValidationException
>(() => options.Value);
34
Assert.Throws<
OptionsValidationException
>(() => options.Value);
Microsoft.Extensions.Diagnostics.Probes.Tests (2)
KubernetesProbesOptionsValidatorTests.cs (2)
86
catch (
OptionsValidationException
ex)
115
Assert.Throws<
OptionsValidationException
>(action);
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpClientLoggingExtensionsTest.cs (2)
216
await act.Should().ThrowAsync<
OptionsValidationException
>();
328
await act.Should().ThrowAsync<
OptionsValidationException
>();
Microsoft.Extensions.Http.Resilience.Tests (4)
Hedging\StandardHedgingTests.cs (2)
49
Assert.Throws<
OptionsValidationException
>(CreateClientWithHandler);
57
Assert.Throws<
OptionsValidationException
>(CreateClientWithHandler);
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (1)
197
Assert.Throws<
OptionsValidationException
>(() => GetPipeline(builder.Services, "test-standard"));
Routing\RoutingStrategyTest.cs (1)
85
Assert.Throws<
OptionsValidationException
>(() => CreateStrategy());
Microsoft.Extensions.Options (7)
IStartupValidator.cs (1)
17
/// <exception cref="
OptionsValidationException
">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating.</exception>
OptionsFactory.cs (1)
53
/// <exception cref="
OptionsValidationException
">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsManager.cs (1)
40
/// <exception cref="
OptionsValidationException
">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsMonitor.cs (2)
75
/// <exception cref="
OptionsValidationException
">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
87
/// <exception cref="
OptionsValidationException
">One or more <see cref="IValidateOptions{TOptions}"/> return failed <see cref="ValidateOptionsResult"/> when validating the <typeparamref name="TOptions"/> instance created.</exception>
OptionsValidationException.cs (1)
15
/// Creates a new instance of <see cref="
OptionsValidationException
"/>.
ValidateOnStart.cs (1)
31
catch (
OptionsValidationException
ex)
Microsoft.Extensions.Options.Contextual.Tests (3)
ContextualOptionsFactoryTests.cs (3)
43
await Assert.ThrowsAsync<
OptionsValidationException
>(async () => await sut.CreateAsync(string.Empty, Mock.Of<IOptionsContext>(), default));
44
await Assert.ThrowsAsync<
OptionsValidationException
>(async () => await sut.CreateAsync("A Name", Mock.Of<IOptionsContext>(), default));
56
await Assert.ThrowsAsync<
OptionsValidationException
>(async () => await sut.CreateAsync("Foo", Mock.Of<IOptionsContext>(), default));