19 instantiations of FakeRedactorOptions
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Logging\HeaderReaderTests.cs (1)
48new FakeRedactorOptions { RedactionFormat = "<redacted:{0}>" }), Prefix);
Logging\RequestHeadersEnricherTests.cs (3)
93.Returns(FakeRedactor.Create(new FakeRedactorOptions { RedactionFormat = "redacted:{0}" })); 124.Returns(FakeRedactor.Create(new FakeRedactorOptions { RedactionFormat = "REDACTED:{0}" })); 275.Returns(FakeRedactor.Create(new FakeRedactorOptions { RedactionFormat = "redacted:{0}" }));
Microsoft.Extensions.Compliance.Testing (3)
FakeRedactor.cs (2)
41var opt = options ?? Microsoft.Extensions.Options.Options.Create(new FakeRedactorOptions()); 71public static FakeRedactor Create(FakeRedactorOptions? options = null, FakeRedactionCollector? collector = null) => new(Options.Options.Create(options ?? new FakeRedactorOptions()), collector);
FakeRedactorProvider.cs (1)
31_redactor = new FakeRedactor(Options.Options.Create(options ?? new FakeRedactorOptions()), Collector);
Microsoft.Extensions.Compliance.Testing.Tests (5)
FakeRedactorOptionsValidatorTests.cs (2)
14var options = new FakeRedactorOptions 35var options = new FakeRedactorOptions
FakeRedactorTests.cs (3)
21var r3 = FakeRedactor.Create(new FakeRedactorOptions()); 36Assert.Throws<ArgumentException>(() => FakeRedactor.Create(new FakeRedactorOptions { RedactionFormat = "{{{{{23123{}}" })); 44var redactor = FakeRedactor.Create(new FakeRedactorOptions { RedactionFormat = RedactedConstOutput });
Microsoft.Extensions.Http.Diagnostics.Tests (1)
HttpHeadersRedactorTests.cs (1)
18var redactorProvider = new FakeRedactorProvider(new FakeRedactorOptions { RedactionFormat = "Redacted:{0}" });
Microsoft.Extensions.Telemetry.Tests (6)
Http\HttpParserTests.cs (1)
478new FakeRedactorOptions { RedactionFormat = "Redacted:{0}" });
Http\HttpRouteFormatterTests.cs (1)
498new FakeRedactorOptions { RedactionFormat = "Redacted:{0}" });
Logging\ExtendedLoggerTests.cs (2)
38var redactorProvider = new FakeRedactorProvider(new FakeRedactorOptions 196var redactorProvider = new FakeRedactorProvider(new FakeRedactorOptions
Logging\JustInTimeRedactorTests.cs (2)
30var shortRedactor = FakeRedactor.Create(new FakeRedactorOptions 35var longRedactor = FakeRedactor.Create(new FakeRedactorOptions
31 references to FakeRedactorOptions
Microsoft.Extensions.Compliance.Testing (22)
FakeRedactionBuilderExtensions.cs (6)
45public static IRedactionBuilder SetFakeRedactor(this IRedactionBuilder builder, Action<FakeRedactorOptions> configure, params DataClassificationSet[] classifications) 51.Services.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsAutoValidator>() 52.Services.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsCustomValidator>() 73.Services.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsAutoValidator>() 74.Services.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsCustomValidator>() 75.Services.Configure<FakeRedactorOptions>(section)
FakeRedactionServiceCollectionExtensions.cs (9)
32var options = serviceProvider.GetRequiredService<IOptions<FakeRedactorOptions>>().Value; 37.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsAutoValidator>() 38.Services.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsCustomValidator>() 49public static IServiceCollection AddFakeRedaction(this IServiceCollection services, Action<FakeRedactorOptions> configure) 58var options = serviceProvider.GetRequiredService<IOptions<FakeRedactorOptions>>().Value; 64.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsAutoValidator>() 65.Services.AddOptionsWithValidateOnStart<FakeRedactorOptions, FakeRedactorOptionsCustomValidator>()
FakeRedactor.cs (3)
39public FakeRedactor(IOptions<FakeRedactorOptions>? options = null, FakeRedactionCollector? collector = null) 43IValidateOptions<FakeRedactorOptions> validator = new FakeRedactorOptionsAutoValidator(); 71public static FakeRedactor Create(FakeRedactorOptions? options = null, FakeRedactionCollector? collector = null) => new(Options.Options.Create(options ?? new FakeRedactorOptions()), collector);
FakeRedactorOptionsAutoValidator.cs (1)
9internal sealed partial class FakeRedactorOptionsAutoValidator : IValidateOptions<FakeRedactorOptions>
FakeRedactorOptionsCustomValidator.cs (2)
10internal sealed class FakeRedactorOptionsCustomValidator : IValidateOptions<FakeRedactorOptions> 14public ValidateOptionsResult Validate(string? name, FakeRedactorOptions options)
FakeRedactorProvider.cs (1)
28public FakeRedactorProvider(FakeRedactorOptions? options = null, FakeRedactionCollector? eventCollector = null)
Microsoft.Extensions.Compliance.Testing.Tests (8)
FakeRedactorOptionsValidatorTests.cs (3)
14var options = new FakeRedactorOptions 23Assert.Contains(nameof(FakeRedactorOptions.RedactionFormat), validationResult.FailureMessage); 35var options = new FakeRedactorOptions
RedactionFakesAcceptanceTests.cs (2)
234Assert.Throws<ArgumentNullException>(() => new ServiceCollection().AddRedaction(x => x.SetFakeRedactor((Action<FakeRedactorOptions>)null!, dc))); 236Assert.Throws<ArgumentNullException>(() => ((IServiceCollection)null!).AddRedaction(x => x.SetFakeRedactor((Action<FakeRedactorOptions>)null!, dc)));
Setup.cs (3)
13FakeRedactorOptions options; 18{ $"{nameof(FakeRedactorOptions)}:{nameof(options.RedactionFormat)}", "What is it? O_o '{0}'" }, 21.GetSection(nameof(FakeRedactorOptions));
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\HttpRequestReaderTest.cs (1)
579Action<FakeRedactorOptions>? configureRedaction = null)