示例#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;
        }
示例#2
0
        public void AddAll_Test()
        {
            var entities = datas;

            var addedEntites = _repo.AddAll(entities).Result;
            var entityList   = addedEntites.ToList();

            Assert.NotNull(addedEntites);
            Assert.True(entityList[0].Id > 0);
            Assert.True(entityList[1].Id > 0);
        }