public void SetUp() { _assemblyOutputDirectoy = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MixerTest"); _modulePath = Path.Combine(_assemblyOutputDirectoy, "Signed.dll"); if (Directory.Exists(_assemblyOutputDirectoy)) { Directory.Delete(_assemblyOutputDirectoy, true); } _mixedTypeFinderStub = MockRepository.GenerateStub <IMixedTypeFinder> (); _mixerPipelineFactoryStub = MockRepository.GenerateStub <IMixerPipelineFactory> (); _pipelineStub = MockRepository.GenerateStub <IPipeline> (); _mixer = new Mixer(_mixedTypeFinderStub, _mixerPipelineFactoryStub, _assemblyOutputDirectoy); _reflectionServiceDynamicMock = MockRepository.GenerateMock <IReflectionService>(); _codeManagerDynamicMock = MockRepository.GenerateMock <ICodeManager>(); _pipelineStub.Stub(stub => stub.ReflectionService).Return(_reflectionServiceDynamicMock); _pipelineStub.Stub(stub => stub.CodeManager).Return(_codeManagerDynamicMock); _fakeMixedType = typeof(int); _configuration = new MixinConfiguration(); _mixedTypeFinderStub.Stub(stub => stub.FindMixedTypes(_configuration)).Return(new[] { _fakeMixedType }); _mixerPipelineFactoryStub.Stub(stub => stub.GetModulePaths(_assemblyOutputDirectoy)).Return(new[] { _modulePath }); _mixerPipelineFactoryStub.Stub(stub => stub.CreatePipeline(_assemblyOutputDirectoy)).Return(_pipelineStub); }
public Mixer(IMixedTypeFinder mixedTypeFinder, IMixerPipelineFactory mixerPipelineFactory, string assemblyOutputDirectory) { ArgumentUtility.CheckNotNull("mixedTypeFinder", mixedTypeFinder); ArgumentUtility.CheckNotNull("mixerPipelineFactory", mixerPipelineFactory); ArgumentUtility.CheckNotNull("assemblyOutputDirectory", assemblyOutputDirectory); MixedTypeFinder = mixedTypeFinder; MixerPipelineFactory = mixerPipelineFactory; AssemblyOutputDirectory = assemblyOutputDirectory; }