protected override IServiceLocator CreateContainer()
        {
            Bootstrapper.Bootstrap();

            var adapter = new StructureMapAdapter(ObjectFactory.Container);

            InitNServiceBus();

            return adapter;
        }
示例#2
0
        public override void Setup()
        {
            _mocks      = new MockRepository();
            _autoMocker = new RhinoAutoMocker <TSut>(MockMode.AAA);
            var serviceLocator = new StructureMapAdapter(_autoMocker.Container);

            ServiceLocator.SetLocatorProvider(() => serviceLocator);
            ProvideImplementationOf <IServiceLocator>(serviceLocator);
            base.Setup();
        }
        public static IRegistry RegisterEasyNetQ(this IRegistry registry, Func <IServiceResolver, ConnectionConfiguration> connectionConfigurationFactory, Action <IServiceRegister> registerServices)
        {
            if (registry == null)
            {
                throw new ArgumentNullException(nameof(registry));
            }

            var serviceRegister = new StructureMapAdapter(registry);

            RabbitHutch.RegisterBus(serviceRegister, connectionConfigurationFactory, registerServices);
            return(registry);
        }
 public StructureMapAdapterTests()
 {
     container = new Mock <IContainer>();
     adapter   = new StructureMapAdapter(container.Object);
 }
 public StructureMapAdapterTests()
 {
     container = new Mock<IContainer>();
     adapter = new StructureMapAdapter(container.Object);
 }