Exemplo n.º 1
0
        public void Initialize()
        {
            var uri = "http://localhost:5050"; //TODO: Move to config

            _server = new WebHostBuilder().UseKestrel().UseStartup <Startup>().UseUrls(uri).Build();
            _server.Start();
            _client = new ShopperApiClient(new ApiSettings(new Uri(uri)));
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            var uri = "http://localhost:5050"; //TODO: Move to config

            _server = new WebHostBuilder().UseKestrel().UseStartup <Startup>().UseUrls(uri).Build();

            var basketStore  = (IDataStore <Api.Models.Basket>)_server.Services.GetService(typeof(IDataStore <Api.Models.Basket>));
            var productStore = (IDataStore <Api.Models.Product>)_server.Services.GetService(typeof(IDataStore <Api.Models.Product>));

            basketStore.Seed(productStore);

            _server.Start();
            _client = new ShopperApiClient(new ApiSettings(new Uri(uri)));
        }