Update test
This commit is contained in:
Родитель
f5c8bf09e2
Коммит
83ea8051c8
|
@ -22,7 +22,7 @@ namespace AntiforgerySample
|
|||
{
|
||||
_next = next;
|
||||
_antiforgery = antiforgery;
|
||||
_options = options.Options;
|
||||
_options = options.Value;
|
||||
}
|
||||
|
||||
public async Task Invoke(HttpContext context)
|
||||
|
|
|
@ -36,14 +36,13 @@ namespace Microsoft.AspNet.Antiforgery
|
|||
{
|
||||
// Arrange
|
||||
var serviceCollection = new ServiceCollection();
|
||||
serviceCollection.AddAntiforgery();
|
||||
serviceCollection.ConfigureDataProtection(o => o.SetApplicationName("HelloWorldApp"));
|
||||
|
||||
serviceCollection.Configure<AntiforgeryOptions>(o =>
|
||||
{
|
||||
Assert.Null(o.CookieName);
|
||||
o.CookieName = "antiforgery";
|
||||
}, order: 9999);
|
||||
});
|
||||
serviceCollection.AddAntiforgery();
|
||||
serviceCollection.ConfigureDataProtection(o => o.SetApplicationName("HelloWorldApp"));
|
||||
|
||||
var services = serviceCollection.BuildServiceProvider();
|
||||
var options = services.GetRequiredService<IOptions<AntiforgeryOptions>>();
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Antiforgery
|
|||
|
||||
public TestOptionsManager(AntiforgeryOptions options)
|
||||
{
|
||||
Options = options;
|
||||
Value = options;
|
||||
}
|
||||
|
||||
public AntiforgeryOptions Value { get; set; } = new AntiforgeryOptions();
|
||||
|
|
Загрузка…
Ссылка в новой задаче