示例#1
0
        public void DeleteAll_Test()
        {
            var entityList = _repo.Get().Result;

            Assert.NotEmpty(entityList);

            var delete            = _repo.DeleteAll().Result;
            var entityListRecheck = _repo.Get().Result;

            Assert.True(delete);
            Assert.Empty(entityListRecheck);
        }
示例#2
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;
        }