Exemple #1
0
        public ExchangeOrderRepositoryTests()
        {
            _repo = new ExchangeOrderRepository();

            // first clear out the table
            var deleted = _repo.DeleteAll().Result;

            // then add some data for testing
            datas.Add(
                new ExchangeOrder
            {
                PlaceDate  = DateTime.UtcNow.AddDays(-4),
                Exchange   = Business.Entities.Exchange.Binance,
                ClosedDate = null,
                Price      = 3489.23M,
                Quantity   = 0.25M,
                Status     = Business.Entities.TradeStatus.Open,
                Side       = Business.Entities.Side.Buy,
                Pair       = "BTCUSDT"
            });
            datas.Add(
                new ExchangeOrder
            {
                PlaceDate  = DateTime.UtcNow.AddDays(-10),
                Exchange   = Business.Entities.Exchange.Binance,
                ClosedDate = DateTime.UtcNow.AddDays(-10),
                Price      = 0.021M,
                Quantity   = 4.5M,
                Status     = Business.Entities.TradeStatus.Filled,
                Side       = Business.Entities.Side.Buy,
                Pair       = "ETHBTC"
            });

            var addedEntites = _repo.AddAll(datas).Result;
        }
 public ExchangeOrderBuilder(IExchangeOrderRepository repo, IExchangeHubBuilder hubBldr)
 {
     this._eoRepo  = repo;
     this._hubBldr = hubBldr;
 }