Пример #1
0
        public void Should_be_able_to_register_and_resolve_transient_open_generic_components()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            RegisterTransientGeneric(container);
            ResolveTransientGeneric(container);
        }
Пример #2
0
        public void Should_be_able_to_register_and_resolve_an_open_generic_singleton()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            RegisterSingletonGeneric(container);
            ResolveSingletonGeneric(container);
        }
Пример #3
0
        public void Should_be_able_to_register_and_resolve_multiple_transient_components()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            RegisterMultipleTransient(container);
            ResolveMultipleTransient(container);
        }
Пример #4
0
        public void Should_be_able_to_register_and_resolve_a_multiple_singleton()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            RegisterMultipleSingleton(container);
            ResolveMultipleSingleton(container);
        }
Пример #5
0
        public void Should_be_able_resolve_all_instances()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            RegisterCollection(container);
            ResolveCollection(container);
        }
Пример #6
0
        public void Start()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            ServiceBus.Register(container);

            _bus = ServiceBus.Create(container).Start();
        }
Пример #7
0
        public void Start()
        {
            var container = new UnityComponentContainer(new UnityContainer());

            container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>();
            container.RegisterServiceBus();

            _bus = container.Resolve <IServiceBus>().Start();
        }
Пример #8
0
        private static void Main(string[] args)
        {
            var container = new UnityComponentContainer(new UnityContainer());

            ServiceBus.Register(container);

            using (var bus = ServiceBus.Create(container).Start())
            {
                string userName;

                while (!string.IsNullOrEmpty(userName = Console.ReadLine()))
                {
                    bus.Send(new RegisterMemberCommand
                    {
                        UserName = userName
                    });
                }
            }
        }
Пример #9
0
        private static void Main(string[] args)
        {
            var container = new UnityComponentContainer(new UnityContainer());

            container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>();
            container.RegisterServiceBus();

            using (var bus = container.Resolve <IServiceBus>().Start())
            {
                string userName;

                while (!string.IsNullOrEmpty(userName = Console.ReadLine()))
                {
                    bus.Send(new RegisterMemberCommand
                    {
                        UserName = userName
                    });
                }
            }
        }