コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }