PageRenderTime 52ms CodeModel.GetById 30ms app.highlight 3ms RepoModel.GetById 18ms app.codeStats 0ms

/src/CommonServiceLocator/CommonServiceLocator.LinFuAdapter.Tests/LinFuServiceLocatorTests.cs

http://github.com/philiplaureano/LinFu
C# | 29 lines | 25 code | 4 blank | 0 comment | 0 complexity | af7685353a36136249f989ea4e04cdc1 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Linq;
 4using System.Text;
 5using CommonServiceLocator.LinFuAdapter.Components;
 6using LinFu.IoC;
 7using LinFu.IoC.Configuration;
 8using NUnit.Framework;
 9
10namespace CommonServiceLocator.LinFuAdapter.Tests
11{
12    [TestFixture]
13    public class LinFuServiceLocatorTests : ServiceLocatorTestCase
14    {
15        protected override Microsoft.Practices.ServiceLocation.IServiceLocator CreateServiceLocator()
16        {
17            var container = new ServiceContainer();
18            container.LoadFromBaseDirectory("*.dll");
19
20            container.AddService(typeof (SimpleLogger).FullName, typeof (ILogger), typeof (SimpleLogger),
21                                 LifecycleType.Singleton);
22
23            container.AddService(typeof(AdvancedLogger).FullName, typeof(ILogger), typeof(AdvancedLogger),
24                                 LifecycleType.Singleton);
25
26            return new LinFuServiceLocator(container);
27        }
28    }
29}