File tree Expand file tree Collapse file tree 3 files changed +33
-10
lines changed
Expand file tree Collapse file tree 3 files changed +33
-10
lines changed Original file line number Diff line number Diff line change 1+ using CommonServiceLocator ;
2+ using Microsoft . Practices . Unity . ServiceLocation . Tests . Components ;
3+ using Microsoft . VisualStudio . TestTools . UnitTesting ;
4+ using Unity ;
5+ using Unity . Lifetime ;
6+ using Unity . ServiceLocation ;
7+
8+ namespace ServiceLocation . Tests
9+ {
10+ [ TestClass ]
11+ public class GitHubIssuesFixture
12+ {
13+ [ TestMethod ]
14+ public void Issue_5 ( )
15+ {
16+ var container = new UnityContainer ( ) ;
17+ container . RegisterType < SimpleLogger > ( new ContainerControlledLifetimeManager ( ) ) ;
18+
19+ var locator = new UnityServiceLocator ( container ) ;
20+ ServiceLocator . SetLocatorProvider ( ( ) => locator ) ;
21+
22+ var logger = ServiceLocator . Current . GetInstance < SimpleLogger > ( ) ;
23+
24+ Assert . IsNotNull ( logger ) ;
25+ Assert . IsInstanceOfType ( logger , typeof ( SimpleLogger ) ) ;
26+ }
27+ }
28+ }
Original file line number Diff line number Diff line change 1-
2-
1+ using CommonServiceLocator ;
2+ using Microsoft . Practices . Unity . ServiceLocation . Tests . Components ;
3+ using Microsoft . VisualStudio . TestTools . UnitTesting ;
34using System ;
45using System . Collections ;
56using System . Collections . Generic ;
6- using CommonServiceLocator ;
7- using Microsoft . Practices . Unity . ServiceLocation . Tests . Components ;
8- using Microsoft . VisualStudio . TestTools . UnitTesting ;
97
108namespace Unity . ServiceLocation . Tests
119{
Original file line number Diff line number Diff line change 1-
2-
3- using System ;
4- using CommonServiceLocator ;
5- using Microsoft . Practices . Unity ;
1+ using CommonServiceLocator ;
62using Microsoft . Practices . Unity . ServiceLocation . Tests . Components ;
73using Microsoft . VisualStudio . TestTools . UnitTesting ;
4+ using System ;
85
96namespace Unity . ServiceLocation . Tests
107{
You can’t perform that action at this time.
0 commit comments