Пример #1
0
        public Runner(SettingsValidator validator,
                      BittrexDataProvider dataProvider,
                      AltCoinFinder altCoinFinder)
        {
            _validator     = validator;
            _dataProvider  = dataProvider;
            _altCoinFinder = altCoinFinder;

            _twitterListener.Elapsed += OnTwitterListenerElapsed;
        }
Пример #2
0
        public void CoinOfTheDayTest()
        {
            const string coinOfTheDayTweet = "Coin of the day: BURST -- First truly Green coin and most overlooked coin. Uses 400 times less power than Bitcoin. " +
                                             "Super secure and private. Includes smart contracts, encrypted messaging, decentralized wallet, libertine blockchain. " +
                                             "Most undervalued coin. https://www.burst-coin.org ";

            var currencies = new BittrexDataProvider()
                             .GetCurrencies();

            const string expectedCoinOfTheDay = "BURST";

            var success = new AltCoinFinder()
                          .TryFindCoinOfTheDay(coinOfTheDayTweet, currencies.Values, out var actualCoinOfTheDay);

            Assert.IsTrue(string.Equals(expectedCoinOfTheDay, actualCoinOfTheDay, StringComparison.OrdinalIgnoreCase));
            Assert.IsTrue(success);

            //var shortName = currencies
            //    .FirstOrDefault(x => x.Value.Equals("Verge", StringComparison.OrdinalIgnoreCase)).Key;

            //new BittrexDataProvider().PlaceBuyOrder(shortName);
        }