示例#1
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();

            _segFactory = ServiceLocator.Current.GetInstance <ISegmentFactory>();
            _segFactory.SetBuildValues(BusinessPartner.Initech);
        }
示例#2
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();
            _sut = ServiceLocator.Current.GetInstance <IEdiFileProcessingService>();

            ensureFilesAreReadyToProcess();
        }
示例#3
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();
            ObjectFactory.Configure(x => x.For <IServiceBus>().Use <FakeServiceBus>());

            _sut = new EdiDocsInService();
        }
        public void SetUp()
        {
            registry = new FubuRegistry(x =>
            {
                x.Route <InputModel>("area/sub/{Name}/{Age}")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route <InputModel>("area/sub2/prop")
                .Calls <TestController>(c => c.SomeAction(null)).OutputToJson();

                x.Route <InputModel>("area/sub2/{Name}/{Age}")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route <InputModel>("area/sub2/{Name}")
                .Calls <TestController>(c => c.ThirdAction(null)).OutputToJson();

                x.Route <InputModel>("area/sub3/{Name}/{Age}")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route("area/sub4/some_pattern")
                .Calls <TestController>(c => c.AnotherAction(null)).OutputToJson();
            });

            container = new Container();


            var bootstrapper = new StructureMapBootstrapper(container, registry);

            routes = new RouteCollection();

            bootstrapper.Bootstrap(routes);

            container.Configure(x => x.For <IOutputWriter>().Use(new InMemoryOutputWriter()));
            Debug.WriteLine(container.WhatDoIHave());
        }
示例#5
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();


            _sut = ServiceLocator.Current.GetInstance <ICreateEdiContentFrom <FinishedAndRawInventoryCountedList> >();
        }
示例#6
0
        static MainController()
        {
            StructureMapBootstrapper.Bootstrap();

            if (!(Debugger.IsAttached || Utils.IsRunningAsUWP))
            {
                // Add the event handler for handling UI thread exceptions to the event.
                System.Windows.Forms.Application.ThreadException += ExceptionHandler;

                // Set the unhandled exception mode to force all Windows Forms errors to go through
                // our handler.
                System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

                // Add the event handler for handling non-UI thread exceptions to the event.
                AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
            }
            //make sure that a language change takes effect after a restart only
            StartupLanguage = PreferencesFactory.get().getProperty("application.language");
            ProtocolFactory.get().register(new FTPProtocol(), new FTPTLSProtocol(), new SFTPProtocol(), new DAVProtocol(),
                                           new DAVSSLProtocol(), new SwiftProtocol(), new S3Protocol(), new GoogleStorageProtocol(),
                                           new AzureProtocol(), new IRODSProtocol(), new SpectraProtocol(), new B2Protocol(), new DriveProtocol(),
                                           new DropboxProtocol(), new HubicProtocol(), new LocalProtocol(), new OneDriveProtocol(), new SharepointProtocol(), new SharepointSiteProtocol(),
                                           new MantaProtocol(), new SDSProtocol(), new StoregateProtocol(), new BrickProtocol(), new NextcloudProtocol());
            ProtocolFactory.get().loadDefaultProfiles();
        }
示例#7
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     StructureMapBootstrapper.Run();
 }
示例#8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            _bootstrapper = new DefaultStructureMapBootstrapper();
            _bootstrapper.Run();

            ShutdownMode = ShutdownMode.OnMainWindowClose;
        }
        public void Should_be_able_to_create_adapter()
        {
            var buildManager = new Mock<IBuildManager>();
            buildManager.SetupGet(bm => bm.Assemblies).Returns(new[] { GetType().Assembly });

            var bootstrapper = new StructureMapBootstrapper(buildManager.Object, new Mock<IBootstrapperTasksRegistry>().Object, new Mock<IPerRequestTasksRegistry>().Object);

            Assert.IsType<StructureMapAdapter>(bootstrapper.Adapter);
        }
示例#10
0
        protected void Application_Start()
        {
            StructureMapBootstrapper.Execute();

            AreaRegistration.RegisterAllAreas();

            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
示例#11
0
 protected void Application_Start()
 {
     StructureMapBootstrapper.Bootstrap();
     ControllerBuilder.Current.SetControllerFactory(new StructureMapController());
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
 }
示例#12
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RegisterRoutes(RouteTable.Routes);

            AutoMapperBootstrapper.ConfigureAutoMapper();
            StructureMapBootstrapper.ConfigureStructureMap();
            ControllerBuilder.Current.SetControllerFactory(new StructureMapControllerFactory());
        }
        public void Should_be_able_to_create_adapter()
        {
            var buildManager = new Mock <IBuildManager>();

            buildManager.SetupGet(bm => bm.Assemblies).Returns(new[] { GetType().Assembly });

            var bootstrapper = new StructureMapBootstrapper(buildManager.Object, new Mock <IBootstrapperTasksRegistry>().Object, new Mock <IPerRequestTasksRegistry>().Object);

            Assert.IsType <StructureMapAdapter>(bootstrapper.Adapter);
        }
示例#14
0
        public void TestFixtureSetUp()
        {
            StructureMapBootstrapper.Execute();
            _repo = ServiceLocator.Current.GetInstance <IIncomingDocumentsRepository>();

            IEnumerable <DocumentInDTO> isaList = get_doc_list();

            isaList.ForEach(_repo.Save);
            _firstDoc = _repo.GetByISAControlNumberAndPartnerID(1001, BusinessPartner.Initech.Number);
        }
示例#15
0
        private void BootstrapStructureMap(FubuRegistry fubuRegistry)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(x => { });

            var fubuBootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);

            fubuBootstrapper.Bootstrap(_routes);
        }
        private static void BootstrapStructureMap(ICollection<RouteBase> routes, FubuRegistry fubuRegistry, Action<IInitializationExpression> initializeExpression)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(initializeExpression);

            var fubuBootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);

            fubuBootstrapper.Bootstrap(routes);
        }
    public virtual void Setup()
    {
        _previousPrincipal = Thread.CurrentPrincipal;
        StructureMapBootstrapper.Restart();
        _services = new RhinoAutoMocker <ACTOR>(MockMode.AAA);

        // _services.Inject(ObjectFactory.GetInstance<IUrlResolver>());
        _output = null;

        beforeEach();
    }
示例#18
0
        public void Setup()
        {
            StructureMapBootstrapper.Execute();
            ObjectFactory.Configure(x =>
            {
                x.For <IServiceBus>().Use <FakeServiceBus>();
                x.For <IEndpointCache>().Use <FakeEndpointResolver>();
            });

            _container     = ObjectFactory.Container;
            _configuration = new AFPSTConfiguration();
        }
示例#19
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();

            ObjectFactory.Configure(x =>
            {
                x.For <IMessagePublisher>().Use <FakeMessagePublisher>();
            });
            _sut =
                ServiceLocator.Current.GetAllInstances <IDocumentParser>().Find(
                    p => p.CanProcess(BusinessPartner.MicroCenter, "850"));
        }
示例#20
0
        public void SetUp()
        {
            MassTransitEdiDocsOutBootstrapper.Execute();
            StructureMapBootstrapper.Execute();



            var docRepo = ServiceLocator.Current.GetInstance <IIncomingDocumentsRepository>();

            // docRepo.Delete(get_save_info());

            get_save_info().ForEach(docRepo.Save);
        }
示例#21
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();

            ObjectFactory.Configure(x =>
            {
                x.For <IMessagePublisher>().Use <FakeMessagePublisher>();
            });

            _resolver = ServiceLocator.Current.GetInstance <IBusinessPartnerResolver <OrderRequestReceivedMessage> >();
            var docRepo = ServiceLocator.Current.GetInstance <IIncomingDocumentsRepository>();

            docRepo.Save(get_save_info());
        }
示例#22
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();

            ObjectFactory.Configure(x =>
            {
                x.For <IServiceBus>().Use <FakeServiceBus>();
            });


            var lst = ServiceLocator.Current.GetAllInstances <ICreateEdiContentFrom <OrderRequestReceivedMessage> >();

            _sut = lst.Find(c => c.CanProcess(GetOrder()));
        }
        private void BootstrapStructureMap(ICollection<RouteBase> routes, FubuRegistry fubuRegistry, Action<IInitializationExpression> initializeExpression)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(initializeExpression);

            var fubuBootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);

            fubuBootstrapper.Bootstrap(routes);

            var existingBuilder = fubuBootstrapper.Builder;

            fubuBootstrapper.Builder = ((container, args, id) =>
                GetBuilder(container, args, id) ?? existingBuilder(container, args, id));
        }
示例#24
0
        /// <summary>Application start.</summary>
        protected void Application_Start()
        {
            var container          = StructureMapBootstrapper.Bootstrap("Ulacit.*");
            var iMapper            = AutoMapperBoostrapper.Bootstrap("Ulacit.*");
            var dependencyRegister = container.GetInstance <IDependencyRegister>();

            dependencyRegister.Register(iMapper);
            GlobalConfiguration.Configuration.UseStructureMap(container);
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
示例#25
0
        public void SetUp()
        {
            StructureMapBootstrapper.Execute();

            ObjectFactory.Configure(x =>
            {
                x.For <IMessagePublisher>().Use <FakeMessagePublisher>();
            });

            var lst = ServiceLocator.Current.GetAllInstances <ICreateEdiContentFrom <OrderHasBeenShippedMessage> >();

            _sut = lst.Find(c => c.CanProcess(GetOrder()));
            var docRepo = ServiceLocator.Current.GetInstance <IIncomingDocumentsRepository>();

            docRepo.Save(get_save_info());
        }
        public void SetUp()
        {
            var registry = new FubuRegistry();

            registry.HtmlConvention(x =>
            {
                x.Displays.Always.BuildBy(req => new HtmlTag("span").Text(req.StringValue()));
                x.Editors.Always.BuildBy(req => new TextboxTag());
                x.DegradeAccessToFields();
            });

            var container = StructureMapBootstrapper.BuildContainer(registry);

            container.Configure(x => x.For <IFieldAccessRule>().Add <TheModelFieldRules>());

            tags       = container.GetInstance <ITagGenerator <TheModel> >();
            tags.Model = new TheModel("No", "ReadOnly", "AllRights");
        }
        private AuthorizationPreviewService withAuthorizationRules(Action <BehaviorGraph> configure)
        {
            var registry = new FubuRegistry();


            registry.Actions.IncludeType <OneController>();
            registry.Actions.IncludeType <TwoController>();

            registry.ResolveTypes(x => x.AddStrategy <UrlModelForwarder>());

            registry.Configure(configure);

            var container    = new Container();
            var bootstrapper = new StructureMapBootstrapper(container, registry);

            bootstrapper.Bootstrap(new List <RouteBase>());

            return(container.GetInstance <AuthorizationPreviewService>());
        }
示例#28
0
        static MainController()
        {
            StructureMapBootstrapper.Bootstrap();
            RegisterImplementations();

            // Add the event handler for handling UI thread exceptions to the event.
            System.Windows.Forms.Application.ThreadException += ExceptionHandler;

            // Set the unhandled exception mode to force all Windows Forms errors to go through
            // our handler.
            System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            // Add the event handler for handling non-UI thread exceptions to the event.
            AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;

            ConfigureLogging();

            //make sure that a language change takes effect after a restart only
            StartupLanguage = Preferences.instance().getProperty("application.language");
        }
示例#29
0
 public static void BootstrapProgram()
 {
     StructureMapBootstrapper.Execute();
     MassTransitEdiDocsInBootstrapper.Execute();
 }
示例#30
0
 public void Setup()
 {
     StructureMapBootstrapper.Execute();
     ObjectFactory.Configure(x => x.For <IServiceBus>().Use <FakeServiceBus>());
     _container = ObjectFactory.Container;
 }
示例#31
0
 public void SetUp()
 {
     StructureMapBootstrapper.Execute();
     _resolver = ServiceLocator.Current.GetInstance <IBusinessPartnerSpecificServiceResolver>();
 }
示例#32
0
 public void SetUp()
 {
     StructureMapBootstrapper.Execute();
     _repo = ServiceLocator.Current.GetInstance <IControlNumberRepository>();
 }
示例#33
0
 public void SetUp()
 {
     StructureMapBootstrapper.Execute();
 }
示例#34
0
 public void SetUpForAllTests()
 {
     StructureMapBootstrapper.Execute();
     MassTransitEdiDocsOutBootstrapper.Execute();
     _sut = ServiceLocator.Current.GetInstance <IBusinessPartnerResolver <OrderChangeRequestReceivedMessage> >();
 }