/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

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using CommonServiceLocator.LinFuAdapter.Components;
  6. using LinFu.IoC;
  7. using LinFu.IoC.Configuration;
  8. using NUnit.Framework;
  9. namespace CommonServiceLocator.LinFuAdapter.Tests
  10. {
  11. [TestFixture]
  12. public class LinFuServiceLocatorTests : ServiceLocatorTestCase
  13. {
  14. protected override Microsoft.Practices.ServiceLocation.IServiceLocator CreateServiceLocator()
  15. {
  16. var container = new ServiceContainer();
  17. container.LoadFromBaseDirectory("*.dll");
  18. container.AddService(typeof (SimpleLogger).FullName, typeof (ILogger), typeof (SimpleLogger),
  19. LifecycleType.Singleton);
  20. container.AddService(typeof(AdvancedLogger).FullName, typeof(ILogger), typeof(AdvancedLogger),
  21. LifecycleType.Singleton);
  22. return new LinFuServiceLocator(container);
  23. }
  24. }
  25. }