This repository has been archived by the owner on Dec 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make services registered in ConfigureServices work in Configure
- Added a test #114
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
test/Microsoft.AspNet.Hosting.Tests/Fakes/StartupWithConfigureServices.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using Microsoft.AspNet.Builder; | ||
using Microsoft.Framework.DependencyInjection; | ||
|
||
namespace Microsoft.AspNet.Hosting.Fakes | ||
{ | ||
public class StartupWithConfigureServices | ||
{ | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
services.AddSingleton<IFoo, Foo>(); | ||
} | ||
|
||
public void Configure(IApplicationBuilder app, IFoo foo) | ||
{ | ||
foo.Bar(); | ||
} | ||
|
||
public interface IFoo | ||
{ | ||
bool Invoked { get; } | ||
void Bar(); | ||
} | ||
|
||
public class Foo : IFoo | ||
{ | ||
public bool Invoked { get; private set; } | ||
|
||
public void Bar() | ||
{ | ||
Invoked = true; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters