public void ProcessAssembly(string path)
        {
            IAssembly        assembly         = _assemblies.LoadAssembly(path);
            EnumerableFinder enumerableFinder = new EnumerableFinder(_log);

            enumerableFinder.FindEnumerables(assembly);
            FactoryMap factories = _factoryFinder.FindFactories(assembly);
            IEnumerable <ConstructorCallWeave> weaves = _constructorCallFinder.FindConstructorCallWeaves(assembly, factories);

            _factoryCallWeaver.WeaveConstructorCalls(weaves, factories);
            _factoryMapSerializer.StoreFactoryMap(assembly, factories);
            assembly.Save(path);
        }
예제 #2
0
        public void ProcessAssembly_Always_AppliesStandardProcessing()
        {
            FactoryMap factoryMap = new FactoryMap();
            List <ConstructorCallWeave> weaves = new List <ConstructorCallWeave>();

            using (_mocks.Record())
            {
                Expect.Call(_assemblies.LoadAssembly("Assembly.dll")).Return(_assembly);
                Expect.Call(_factoryFinder.FindFactories(_assembly)).Return(factoryMap);
                Expect.Call(_constructorCallFinder.FindConstructorCallWeaves(_assembly, factoryMap)).Return(weaves);
                _factoryCallWeaver.WeaveConstructorCalls(weaves, factoryMap);
                _factoryMapSerializer.StoreFactoryMap(_assembly, factoryMap);
                _assembly.Save("Assembly.dll");
            }
            _target.ProcessAssembly("Assembly.dll");
            _mocks.VerifyAll();
        }