Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Commit

Permalink
Tweak test to scoped IConfigureOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoK committed Jan 31, 2017
1 parent e1fd153 commit a72690e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/Microsoft.Extensions.Options.Test/OptionsSnapshotTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ private class TestConfigure : IConfigureOptions<FakeOptions>
{
public static int ConfigureCount;

public void Configure(FakeOptions options)
public TestConfigure()
{
ConfigureCount++;
}

public void Configure(FakeOptions options)
{
}
}


Expand All @@ -113,7 +117,7 @@ public void SnapshotOptionsAreRecreatedPerScope()
{
var services = new ServiceCollection()
.AddOptions()
.AddSingleton<IConfigureOptions<FakeOptions>, TestConfigure>()
.AddScoped<IConfigureOptions<FakeOptions>, TestConfigure>()
.BuildServiceProvider();

var factory = services.GetRequiredService<IServiceScopeFactory>();
Expand Down

0 comments on commit a72690e

Please sign in to comment.