public void Setup() { var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var modulesPath = Path.Combine(assemblyLocation !, "..\\..\\Modules\\netstandard2.0"); //Setup the container var catalog = new AggregateCatalog(); catalog.Catalogs.Add(new AssemblyCatalog(typeof(Program).Assembly)); catalog.Catalogs.Add(new DirectoryCatalog(modulesPath)); _container = new CompositionContainer(catalog); _container.Compose(new CompositionBatch()); _marsSurfaceFactory = _container.GetExportedValue <IMarsSurfaceFactory>(); _martianRobotFactory = _container.GetExportedValue <IMartianRobotFactory>(); }
public ConsoleApplication(IMarsSurfaceFactory marsSurfaceFactory, IMartianRobotFactory martianRobotFactory) { _marsSurfaceFactory = marsSurfaceFactory; _martianRobotFactory = martianRobotFactory; }