public void GetTakerOrderFeeTest() { var order = new Mock <MarketOrder>(); order.Setup(o => o.Type).Returns(OrderType.Market); order.Object.Quantity = 10; decimal expected = 2m; var actual = unit.GetOrderFee(security.Object, order.Object); Assert.AreEqual(expected, actual); }
public void ReturnLongOrderTakerFees(OrderTestParameters parameters) { IFeeModel feeModel = new BitfinexFeeModel(); Order order = parameters.CreateLongOrder(Quantity); var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : HighPrice; Assert.AreEqual( BitfinexFeeModel.TakerFee * price * Math.Abs(Quantity), feeModel.GetOrderFee(Security, order)); }
public void ReturnShortOrderMakerFees(OrderTestParameters parameters) { IFeeModel feeModel = new BitfinexFeeModel(); Order order = parameters.CreateShortOrder(Quantity); var price = order.Type == OrderType.Limit ? ((LimitOrder)order).LimitPrice : LowPrice; var fee = feeModel.GetOrderFee(new OrderFeeParameters(Security, order)); Assert.AreEqual( BitfinexFeeModel.MakerFee * price * Math.Abs(Quantity), fee.Value.Amount); Assert.AreEqual(Currencies.USD, fee.Value.Currency); }