public static void Configure()
        {
            var builder = new ContainerBuilder();

            builder.RegisterApiControllers(typeof(MvcApplication).Assembly).PropertiesAutowired().InstancePerHttpRequest();
            builder.RegisterControllers(typeof(MvcApplication).Assembly).PropertiesAutowired().InstancePerHttpRequest();

            builder.RegisterType<Logger>().As<ILogger>();
            builder.RegisterType<SimpleDataModificator>();
            builder.RegisterType<XmlDataModificator>();
            builder.RegisterType<Config>();

            var config = new Config(new Logger());

            switch (config.GetDataSource())
            {
                case DataSourse.DataBase:
                    builder.RegisterType<SimpleDataRepresentator>().As<IDataRepresentator>();
                    break;

                case DataSourse.Xml:
                    builder.RegisterType<XmlDataRepresentator>().As<IDataRepresentator>();
                    break;

                default:
                    throw new NotImplementedException();
            }

            var container = builder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
            GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container);
        }
 public FileSystem(ILogger log, Config config)
 {
     this.log = log;
     this.config = config;
 }
 public void Init()
 {
     log = new Mock<Logger>();
     sut = new Config(log.Object);
 }