示例#1
0
        public AppHostFixture()
        {
            var config = new HostConfig {
                WebHostUrl = "http://localhost", DebugMode = true
            };

            TestTypes = new[]
            {
                new KeyValuePair <Type, string>(typeof(TestDto), typeof(TestDto).Name),
                new KeyValuePair <Type, string>(typeof(TestDto2), typeof(TestDto2).Name)
            };
            var plugins = new List <IPlugin>();

            plugins.Add(new NativeTypesFeature());
            plugins.Add(new ConsulFeature(settings =>
            {
                settings.AddServiceDiscovery(new TestServiceDiscovery(TestTypes));
            }));

            Host = new BasicAppHost
            {
                TestMode = true,
                Config   = config,
                Plugins  = plugins,
            };

            Host.Init();
            Host.Config.WebHostUrl = "http://localhost";
        }
        public void TestInit()
        {
            LogManager.LogFactory = new ConsoleLogFactory();

            _appHost = new BasicAppHost();
            _appHost.Init();

            var container = _appHost.Container;

            container.RegisterAutoWired <HelloService>();
        }
        public void TestInit()
        {
            if (_appHost == null)
            {
                LogManager.LogFactory = new ConsoleLogFactory();

                _appHost = new BasicAppHost();
                _appHost.Init();

                var store = NewDocumentStore();
                DataInitializer.InitializerWithDefaultValuesIfEmpty(store);

                _appHost.Container.RegisterAutoWired <ConfigurationService>();
            }
        }
        public AppHostFixture()
        {
            var hostConfig = new HostConfig
            {
                WebHostUrl         = WebHostUrl,
                HandlerFactoryPath = HandlerFactoryPath,
                DebugMode          = true
            };

            AppHost = new BasicAppHost
            {
                TestMode    = true,
                Config      = hostConfig,
                ServiceName = ServiceName
            };

            AppHost.Init();
            AppHost.Config.WebHostUrl         = WebHostUrl;
            AppHost.Config.HandlerFactoryPath = HandlerFactoryPath;
        }