示例#1
0
        public void Setup()
        {
            var mockHttp = new MockHttpMessageHandler();
            var client   = mockHttp.ToHttpClient();

            var stockMarketAPI  = new StockMarketAPI(client);
            var stockMarketData = new StockMarketData(stockMarketAPI);

            TestHelpers.MockStockData(mockHttp);
            TestHelpers.MockFondData(mockHttp);
            TestHelpers.MockBondData(mockHttp);

            TestHelpers.MockDividendData(mockHttp);
            TestHelpers.MockCouponsData(mockHttp);

            var context = TestHelpers.GetMockFinanceDbContext();

            TestHelpers.SeedOperations1(context);

            _financeDataService = new FinanceDataService(context);
            var assetFactory   = new AssetsFactory(_financeDataService, stockMarketData);
            var balanceService = new BalanceService(_financeDataService);

            _marketService    = new MarketService(_financeDataService, assetFactory, balanceService);
            _portfolioService = new PortfolioService(_financeDataService, balanceService, assetFactory);
        }
        public void Setup()
        {
            _mockHttp = new MockHttpMessageHandler();
            var client = _mockHttp.ToHttpClient();

            var stockMarketAPI = new StockMarketAPI(client);

            _stockMarketData = new StockMarketData(stockMarketAPI);
        }
示例#3
0
        public void Setup()
        {
            _mockHttp = new MockHttpMessageHandler();
            var client         = _mockHttp.ToHttpClient();
            var stockMarketAPI = new StockMarketAPI(client);

            MockData();
            var stockMarketData = new StockMarketData(stockMarketAPI);

            _graphService = new GraphService(stockMarketData);
        }
        public void Setup()
        {
            var mockHttp = new MockHttpMessageHandler();
            var client   = mockHttp.ToHttpClient();

            var stockMarketAPI  = new StockMarketAPI(client);
            var stockMarketData = new StockMarketData(stockMarketAPI);

            TestHelpers.MockStockData(mockHttp);

            _data = stockMarketData.GetStockData("YNDX").Result;
        }
示例#5
0
        public void Setup()
        {
            var mockHttp = new MockHttpMessageHandler();
            var client   = mockHttp.ToHttpClient();

            TestHelpers.MockBondData(mockHttp);
            TestHelpers.MockCouponsData(mockHttp);
            var stockMarketAPI = new StockMarketAPI(client);

            _stockMarketData = new StockMarketData(stockMarketAPI);

            var context = TestHelpers.GetMockFinanceDbContext();

            _financeDataService = new FinanceDataService(context);
        }
示例#6
0
        public void Setup()
        {
            var mockHttp = new MockHttpMessageHandler();
            var client   = mockHttp.ToHttpClient();

            var stockMarketAPI  = new StockMarketAPI(client);
            var stockMarketData = new StockMarketData(stockMarketAPI);

            TestHelpers.MockStockData(mockHttp);
            TestHelpers.MockFondData(mockHttp);
            TestHelpers.MockDividendData(mockHttp);

            var context = TestHelpers.GetMockFinanceDbContext();

            TestHelpers.SeedOperations1(context);
            var financeDataService = new FinanceDataService(context);

            _assetFactory = new AssetsFactory(financeDataService, stockMarketData);
        }
示例#7
0
        public void Setup()
        {
            _mockHttp = new MockHttpMessageHandler();
            var client         = _mockHttp.ToHttpClient();
            var stockMarketAPI = new StockMarketAPI(client);

            MockData();
            var stockMarketData = new StockMarketData(stockMarketAPI);

            var context = TestHelpers.GetMockFinanceDbContext();

            TestHelpers.SeedOperations1(context);
            var financeDataService = new FinanceDataService(context);

            TestHelpers.MockStockData(_mockHttp);
            TestHelpers.MockFondData(_mockHttp);
            TestHelpers.MockBondData(_mockHttp);

            TestHelpers.MockDividendData(_mockHttp);
            TestHelpers.MockCouponsData(_mockHttp);

            _searchService = new SearchService(stockMarketData, financeDataService);
        }
        public async Task Setup()
        {
            var mockHttp = new MockHttpMessageHandler();
            var client   = mockHttp.ToHttpClient();

            var stockMarketApi  = new StockMarketAPI(client);
            var stockMarketData = new StockMarketData(stockMarketApi);

            var context = TestHelpers.GetMockFinanceDbContext();

            _financeDataService = new FinanceDataService(context);

            var assetFactory = new AssetsFactory(_financeDataService, stockMarketData);

            _balanceService = new BalanceService(_financeDataService);
            TestHelpers.SeedApp(context);
            _portfolioService = new PortfolioService(_financeDataService, _balanceService, assetFactory);

            TestHelpers.MockStockData(mockHttp);
            TestHelpers.MockFondData(mockHttp);
            TestHelpers.MockBondData(mockHttp);

            TestHelpers.SeedOperations2(context);
        }