public void InterfaceOk() { OrderTransaction trans = new OrderTransaction(); trans.Direction = OrderDirection.Buy; IPositionInventory lifo = new PositionInventoryLifo(); lifo.Add(trans); var count = lifo.BuysCount(); Assert.IsTrue(lifo.BuysCount() == 1); trans = lifo.RemoveBuy(); Assert.IsNotNull(trans); Assert.IsTrue(lifo.BuysCount() == 0); }
public IPositionInventory OpenPosition(OrderTransaction trans, PositionInventoryMethod positionResolution) { IPositionInventory position; if (positionResolution == PositionInventoryMethod.Fifo) { position = new PositionInventoryFifo(); } else { position = new PositionInventoryLifo(); } position.Add(trans); return(position); }
public IPositionInventory OpenPosition(OrderTransaction trans, PositionInventoryMethod positionResolution) { IPositionInventory position; if (positionResolution == PositionInventoryMethod.Fifo) position = new PositionInventoryFifo(); else { position = new PositionInventoryLifo(); } position.Add(trans); return position; }
public void Setup() { lifo = new PositionInventoryLifo(); fifo = new PositionInventoryFifo(); }