public void OnStopHit_NotCloseOnPrice__ReturnsFalse() { ClosingPositionSelector.OnStopHit(new Position() { CloseMode = PositionCloseMode.OnClose }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeFalse(); }
public void OnClose_CloseOnClose__ReturnsTrue() { ClosingPositionSelector.OnClose(new Position() { CloseMode = PositionCloseMode.OnClose }, StockPricesDataUtils.CreatePricesData(0, 0, 0, 0), 0).ShouldBeTrue(); }
public void OnStopHit(PositionDir positionDir, float closeModePrice, bool expected) { ClosingPositionSelector.OnStopHit( new Position() { Direction = positionDir, CloseMode = PositionCloseMode.OnStopHit, CloseModePrice = closeModePrice }, StockPricesDataUtils.CreatePricesData(0, 100, 50, 0), 0).ShouldBe(expected); }