public void GetAllFundEmpty() { var alloc = new AllocationManager(LoggerFactory, _fetcher, null); alloc.SetInitialConfiguration(new Portfolio(new Dictionary <Currency, Balance>())); var funds = alloc.GetAllFunds(); Assert.NotNull(funds); Assert.Empty(funds.AllBalances()); }
public void ValidateAllocationsSetRequired() { var allocationManager = new AllocationManager(LoggerFactory, _fetcher, null); Currency c = new Currency("ETH"); Assert.Throws <ArgumentNullException>(() => allocationManager.GetAvailableFunds(c)); Assert.Throws <ArgumentNullException>(() => allocationManager.GetAllFunds()); Assert.Throws <ArgumentNullException>(() => allocationManager.QueueTrade( new TradeProposal(TradingPair.Parse("EOSETH"), new Balance(c, 10, 10)), () => new OrderUpdate( orderId: 0, tradeId: 0, orderStatus: OrderUpdate.OrderStatus.New, orderType: OrderUpdate.OrderTypes.Limit, createdTimestamp: 0, setPrice: 0, side: OrderSide.Buy, pair: TradingPair.Parse("EOSETH"), setQuantity: 0))); }