Esempio n. 1
0
        public void Arrange(double expectedTotalAmount)
        {
            var container = IoCBootstrapper.Init();

            CheckOutProcessor = container.Resolve <CheckOutProcessor>();

            var productRepository = container.Resolve <IProductRepository>();

            _products = productRepository.GetProducts();

            ExpectedTotalAmount = expectedTotalAmount;
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            var container = IoCBootstrapper.Init();

            using (var scope = container.BeginLifetimeScope())
            {
                var service = scope.Resolve <SampleService>();

                service.Start();

                Console.WriteLine("Service started, press enter to quit...");
                Console.ReadLine();

                service.Stop();
            }
        }
Esempio n. 3
0
        private static void Main()
        {
            var container = IoCBootstrapper.Init();

            HostFactory.Run(
                h =>
            {
                h.SetServiceName("Jobbie.Sample.Client.WebApi.Host");
                h.SetDisplayName("Jobbie.Sample.Client.WebApi.Host");

                h.UseAutofacContainer(container);

                h.Service <HostService>(
                    s =>
                {
                    s.ConstructUsingAutofacContainer();
                    s.WhenStarted(x => x.Start());
                    s.WhenStopped(x => x.Stop());
                });
            });
        }
Esempio n. 4
0
        private static void Main()
        {
            ConfigureLogging();

            HostFactory.Run(
                h =>
            {
                h.SetServiceName("Jobbie.Sample.Executor.Host");
                h.SetDisplayName("Jobbie.Sample.Executor.Host");

                h.UseAutofacContainer(IoCBootstrapper.Init());

                h.Service <HostService>(
                    s =>
                {
                    s.ConstructUsingAutofacContainer();
                    s.WhenStarted(x => x.Start());
                    s.WhenStopped(x => x.Stop());
                });
            });
        }