public void GetAccountInfo_Should_ReturnAccountInfo()
        {
            // arrange
            var expected =
                new BitfinexAccountInfo()
            {
                MakerFee = 0.1m,
                TakerFee = 0.2m,
                Fees     = new[]
                {
                    new BitfinexFee
                    {
                        TakerFee = 0.3m,
                        MakerFee = 0.4m,
                        Pairs    = "BTC"
                    }
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new[] { expected }));

            // act
            var result = client.GetAccountInfo();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data, "Fees"));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected.Fees[0], result.Data.Fees[0]));
        }
        public void GetTicker_Should_RespondWithPrices()
        {
            // arrange
            var expected = new []
            {
                new BitfinexMarketOverviewRest()
                {
                    Ask     = 0.1m,
                    AskSize = 0.2m,
                    Bid     = 0.3m,
                    BidSize = 0.4m,
                    DailtyChangePercentage = 0.5m,
                    DailyChange            = 0.6m,
                    High      = 0.7m,
                    LastPrice = 0.8m,
                    Low       = 0.9m,
                    Volume    = 1.1m,
                    Symbol    = "Test"
                }
            };

            var client = PrepareClient(JsonConvert.SerializeObject(new object[] { new object[] { "Test", 0.3m, 0.4m, 0.1m, 0.2m, 0.6m, 0.5m, 0.8m, 1.1m, 0.7m, 0.9m } }));

            // act
            var result = client.GetTicker("Test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
        }
        public void GetMovements_Should_RespondWithMovements()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexMovement()
                {
                    Id            = "test",
                    Amount        = 0.1m,
                    Status        = "Status",
                    Currency      = "Cur",
                    Address       = "add",
                    CurrencyName  = "curname",
                    Fees          = 0.2m,
                    Started       = new DateTime(2017, 1, 1),
                    TransactionId = "tx",
                    Updated       = new DateTime(2017, 1, 1)
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { "test", "Cur", "curname", null, null, GetTimestamp(new DateTime(2017, 1, 1)), GetTimestamp(new DateTime(2017, 1, 1)), null, null, "Status", null, null, 0.1m, 0.2m, null, null, "add", null, null, null, "tx", null }
            }));

            // act
            var result = client.GetMovements("test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
        }
        public void GetAlertList_Should_RespondWithAlerts()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexAlert()
                {
                    AlertKey  = "key",
                    AlertType = "type",
                    Price     = 0.1m,
                    Symbol    = "symbol",
                    T         = 0.2m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { "key", "type", "symbol", 0.1m, 0.2m }
            }));

            // act
            var result = client.GetAlertList();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
        }
        public void GetFundingInfo_Should_RespondWithFundingInfo()
        {
            // arrange
            var expected = new BitfinexFundingInfo()
            {
                Symbol = "test",
                Type   = "sym",
                Data   = new BitfinexFundingInfoDetails()
                {
                    DurationLend = 0.1m,
                    DurationLoan = 0.2m,
                    YieldLend    = 0.3m,
                    YieldLoan    = 0.4m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                "sym", "test", new object[] { 0.4m, 0.3m, 0.2m, 0.1m }
            }));

            // act
            var result = client.GetFundingInfo("test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
        public void GetTrades_Should_RespondWithPrices()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexTradeSimple()
                {
                    Amount    = 0.1m,
                    Id        = 1,
                    Price     = 0.2m,
                    Timestamp = new DateTime(2017, 1, 1)
                },
                new BitfinexTradeSimple()
                {
                    Amount    = 0.3m,
                    Id        = 2,
                    Price     = 0.4m,
                    Timestamp = new DateTime(2016, 1, 1)
                }
            };

            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 1, GetTimestamp(new DateTime(2017, 1, 1)), 0.1m, 0.2m },
                new object[] { 2, GetTimestamp(new DateTime(2016, 1, 1)), 0.3m, 0.4m }
            }));

            // act
            var result = client.GetTrades("Test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
        public void GetSymbolMargin_Should_RespondWithMargin()
        {
            // arrange
            var expected = new BitfinexMarginSymbol()
            {
                Symbol = "test",
                Data   = new BitfinexMarginSymbolInfo()
                {
                    Buy              = 0.1m,
                    GrossBalance     = 0.2m,
                    Sell             = 0.3m,
                    TradeableBalance = 0.4m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                "test", new object[] { 0.4m, 0.2m, 0.1m, 0.3m }
            }));

            // act
            var result = client.GetSymbolMarginInfo("test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
        public void GetBaseMargin_Should_RespondWithMargin()
        {
            // arrange
            var expected = new BitfinexMarginBase()
            {
                Type = "base",
                Data = new BitfinexMarginBaseInfo()
                {
                    MarginBalance   = 0.1m,
                    MarginNet       = 0.2m,
                    UserProfitLoss  = 0.3m,
                    UserSwapsAmount = 0.4m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                "base", new object[] { 0.3m, 0.4m, 0.1m, 0.2m }
            }));

            // act
            var result = client.GetBaseMarginInfo();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
        public void GetOrderbook_Should_RespondWithOrderbook()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexOrderBookEntry()
                {
                    Amount = 0.1m,
                    Price  = 0.2m,
                    Count  = 1
                },
                new BitfinexOrderBookEntry()
                {
                    Amount = 0.3m,
                    Price  = 0.4m,
                    Count  = 2
                }
            };

            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 0.2m, 1, 0.1m },
                new object[] { 0.4m, 2, 0.3m }
            }));

            // act
            var result = client.GetOrderBook("Test", Precision.PrecisionLevel0);

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
        public void GetActiveFundingOffers_Should_RespondWithFundingOffers()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexFundingOffer()
                {
                    Amount           = 0.1m,
                    Symbol           = "Test",
                    Id               = 1,
                    Status           = OrderStatus.Active,
                    StatusString     = "ACTIVE",
                    TimestampCreated = new DateTime(2017, 1, 1),
                    TimestampUpdated = new DateTime(2017, 1, 1),
                    Flags            = 0,
                    AmountOriginal   = 0.2m,
                    Notify           = false,
                    Hidden           = false,
                    FundingType      = FundingType.Lend,
                    Period           = 1,
                    Rate             = 0.3m,
                    RateReal         = 0.4m,
                    Renew            = false
                },
                new BitfinexFundingOffer()
                {
                    Amount           = 0.5m,
                    Symbol           = "Test",
                    Id               = 2,
                    Status           = OrderStatus.PartiallyFilled,
                    StatusString     = "INSUFFICIENT BALANCE (G1) was: ACTIVE (note:POSCLOSE), PARTIALLY FILLED @ 6123.96104092(-0.07139999)",
                    TimestampCreated = new DateTime(2016, 1, 1),
                    TimestampUpdated = new DateTime(2016, 1, 1),
                    Flags            = 0,
                    AmountOriginal   = 0.6m,
                    Notify           = true,
                    Hidden           = true,
                    FundingType      = FundingType.Loan,
                    Period           = 2,
                    Rate             = 0.7m,
                    RateReal         = 0.8m,
                    Renew            = true
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 1, "Test", GetTimestamp(new DateTime(2017, 1, 1)), GetTimestamp(new DateTime(2017, 1, 1)), 0.1m, 0.2m, "lend", null, null, 0, "ACTIVE", null, null, null, 0.3m, 1, 0, 0, null, 0, 0.4m },
                new object[] { 2, "Test", GetTimestamp(new DateTime(2016, 1, 1)), GetTimestamp(new DateTime(2016, 1, 1)), 0.5m, 0.6m, "loan", null, null, 0, "INSUFFICIENT BALANCE (G1) was: ACTIVE (note:POSCLOSE), PARTIALLY FILLED @ 6123.96104092(-0.07139999)", null, null, null, 0.7m, 2, 1, 1, null, 1, 0.8m },
            }));

            // act
            var result = client.GetActiveFundingOffers("Test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #11
0
        public void GetTradesForOrder_Should_RespondWithTrades()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexTradeDetails()
                {
                    Id = 1,
                    TimestampCreated = new DateTime(2017, 1, 1),
                    ExecutedAmount   = 0.1m,
                    ExecutedPrice    = 0.2m,
                    Fee         = 0.3m,
                    FeeCurrency = "Test",
                    Maker       = false,
                    OrderId     = 2,
                    OrderPrice  = 0.4m,
                    OrderType   = OrderType.Limit,
                    Pair        = "TEST"
                },
                new BitfinexTradeDetails()
                {
                    Id = 3,
                    TimestampCreated = new DateTime(2016, 1, 1),
                    ExecutedAmount   = 0.5m,
                    ExecutedPrice    = 0.6m,
                    Fee         = 0.7m,
                    FeeCurrency = "Test",
                    Maker       = false,
                    OrderId     = 4,
                    OrderPrice  = 0.8m,
                    OrderType   = OrderType.Market,
                    Pair        = "TEST"
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 1, "TEST", GetTimestamp(new DateTime(2017, 1, 1)), 2, 0.1m, 0.2m, "LIMIT", 0.4m, -1, 0.3m, "Test" },
                new object[] { 3, "TEST", GetTimestamp(new DateTime(2016, 1, 1)), 4, 0.5m, 0.6m, "MARKET", 0.8m, -1, 0.7m, "Test" },
            }));

            // act
            var result = client.GetTradesForOrder("TEST", 1);

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #12
0
        public void GetPlatformStatus_Should_RespondWithPlatformStatus()
        {
            // arrange
            var expected = new BitfinexPlatformStatus()
            {
                Status = PlatformStatus.Operative
            };

            var client = PrepareClient(JsonConvert.SerializeObject(new object[] { (int)expected.Status }));

            // act
            var result = client.GetPlatformStatus();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
Beispiel #13
0
        public void GetActivePositions_Should_RespondWithPositions()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexPosition()
                {
                    Amount               = 0.1m,
                    Symbol               = "Test",
                    Status               = PositionStatus.Active,
                    BasePrice            = 0.2m,
                    Leverage             = 0.3m,
                    LiquidationPrice     = 0.4m,
                    MarginFunding        = 0.5m,
                    MarginFundingType    = MarginFundingType.Daily,
                    ProfitLoss           = 0.6m,
                    ProfitLossPercentage = 0.7m
                },
                new BitfinexPosition()
                {
                    Amount               = 0.8m,
                    Symbol               = "Test2",
                    Status               = PositionStatus.Closed,
                    BasePrice            = 0.9m,
                    Leverage             = 1.1m,
                    LiquidationPrice     = 1.2m,
                    MarginFunding        = 1.3m,
                    MarginFundingType    = MarginFundingType.Term,
                    ProfitLoss           = 1.4m,
                    ProfitLossPercentage = 1.5m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { "Test", "ACTIVE", 0.1m, 0.2m, 0.5m, 0, 0.6m, 0.7m, 0.4m, 0.3m },
                new object[] { "Test2", "CLOSED", 0.8m, 0.9m, 1.3m, 1, 1.4m, 1.5m, 1.2m, 1.1m },
            }));

            // act
            var result = client.GetActivePositions();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #14
0
        public void GetMarketAveragePrice_Should_RespondWithAveragePrice()
        {
            // arrange
            var expected =
                new BitfinexMarketAveragePrice()
            {
                Amount      = 0.1m,
                AverageRate = 0.2m
            };

            var client = PrepareClient(JsonConvert.SerializeObject(new object[] { 0.2m, 0.1m }));

            // act
            var result = client.GetMarketAveragePrice("test", 0.1m, 0.2m);

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
Beispiel #15
0
        public void GetStats_Should_RespondWithStats()
        {
            // arrange
            var expected =
                new BitfinexStats()
            {
                Timestamp = new DateTime(2017, 1, 1),
                Value     = 0.1m
            };

            var client = PrepareClient(JsonConvert.SerializeObject(new object[] { GetTimestamp(new DateTime(2017, 1, 1)), 0.1m }));

            // act
            var result = client.GetStats("test", StatKey.ActiveFundingInPositions, StatSide.Long, StatSection.History);

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
Beispiel #16
0
        public void GetFundingTradesHistory_Should_RespondWithFundingTrades()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexFundingTrade()
                {
                    Id        = 1,
                    Amount    = 0.1m,
                    Timestamp = new DateTime(2017, 1, 1),
                    Rate      = 0.2m,
                    Period    = 2,
                    Currency  = "Test",
                    Maker     = false,
                    OfferId   = 3
                },
                new BitfinexFundingTrade()
                {
                    Id        = 4,
                    Amount    = 0.3m,
                    Timestamp = new DateTime(2016, 1, 1),
                    Rate      = 0.4m,
                    Period    = 5,
                    Currency  = "Test",
                    Maker     = true,
                    OfferId   = 6
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 1, "Test", GetTimestamp(new DateTime(2017, 1, 1)), 3, 0.1m, 0.2m, 2, 0 },
                new object[] { 4, "Test", GetTimestamp(new DateTime(2016, 1, 1)), 6, 0.3m, 0.4m, 5, 1 },
            }));

            // act
            var result = client.GetFundingTradesHistory("Test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #17
0
        public void DeleteAlert_Should_ReturnSuccess()
        {
            // arrange
            var expected =
                new BitfinexSuccessResult()
            {
                Success = true
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                "true"
            }));

            // act
            var result = client.DeleteAlert("symbol", 0.1m);

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected, result.Data));
        }
Beispiel #18
0
        public void GetCandles_Should_RespondWithCandles()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexCandle()
                {
                    Timestamp = new DateTime(2017, 1, 1),
                    Volume    = 0.1m,
                    Low       = 0.2m,
                    High      = 0.3m,
                    Close     = 0.4m,
                    Open      = 0.5m
                },
                new BitfinexCandle()
                {
                    Timestamp = new DateTime(2016, 1, 1),
                    Volume    = 0.6m,
                    Low       = 0.7m,
                    High      = 0.8m,
                    Close     = 0.9m,
                    Open      = 1.1m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { GetTimestamp(new DateTime(2017, 1, 1)), 0.5m, 0.4m, 0.3m, 0.2m, 0.1m },
                new object[] { GetTimestamp(new DateTime(2016, 1, 1)), 1.1m, 0.9m, 0.8m, 0.7m, 0.6m }
            }));

            // act
            var result = client.GetCandles(TimeFrame.FiveMinute, "test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #19
0
        public void GetWallets_Should_RespondWithWallets()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexWallet()
                {
                    Balance           = 0.1m,
                    BalanceAvailable  = 0.2m,
                    Currency          = "test",
                    Type              = WalletType.Exchange,
                    UnsettledInterest = 0.3m
                },
                new BitfinexWallet()
                {
                    Balance           = 0.4m,
                    BalanceAvailable  = 0.5m,
                    Currency          = "test2",
                    Type              = WalletType.Funding,
                    UnsettledInterest = 0.6m
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { "exchange", "test", 0.1m, 0.3m, 0.2m },
                new object[] { "funding", "test2", 0.4m, 0.6m, 0.5m },
            }));

            // act
            var result = client.GetWallets();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #20
0
        public void GetFundingCredits_Should_RespondWithFundingCredits()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexFundingCredit()
                {
                    Amount              = 0.1m,
                    Symbol              = "Test",
                    Id                  = 1,
                    Status              = OrderStatus.Active,
                    TimestampCreated    = new DateTime(2017, 1, 1),
                    TimestampUpdated    = new DateTime(2017, 1, 1),
                    Flags               = 0,
                    Notify              = false,
                    Hidden              = false,
                    Period              = 1,
                    Rate                = 0.3m,
                    RateReal            = 0.4m,
                    Renew               = false,
                    NoClose             = false,
                    Side                = FundingType.Lend,
                    TimestampLastPayout = new DateTime(2017, 1, 1),
                    TimestampOpened     = new DateTime(2017, 1, 1),
                    PositionPair        = "Test"
                },
                new BitfinexFundingCredit()
                {
                    Amount              = 0.5m,
                    Symbol              = "Test",
                    Id                  = 2,
                    Status              = OrderStatus.Canceled,
                    TimestampCreated    = new DateTime(2016, 1, 1),
                    TimestampUpdated    = new DateTime(2016, 1, 1),
                    Flags               = 0,
                    Notify              = true,
                    Hidden              = true,
                    Period              = 2,
                    Rate                = 0.7m,
                    RateReal            = 0.8m,
                    Renew               = true,
                    NoClose             = true,
                    Side                = FundingType.Loan,
                    TimestampLastPayout = new DateTime(2016, 1, 1),
                    TimestampOpened     = new DateTime(2016, 1, 1),
                    PositionPair        = "Test"
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 1, "Test", "lend", GetTimestamp(new DateTime(2017, 1, 1)), GetTimestamp(new DateTime(2017, 1, 1)), 0.1m, 0, "ACTIVE", null, null, null, 0.3m, 1, GetTimestamp(new DateTime(2017, 1, 1)), GetTimestamp(new DateTime(2017, 1, 1)), 0, 0, null, 0, 0.4m, 0, "Test" },
                new object[] { 2, "Test", "loan", GetTimestamp(new DateTime(2016, 1, 1)), GetTimestamp(new DateTime(2016, 1, 1)), 0.5m, 0, "CANCELED", null, null, null, 0.7m, 2, GetTimestamp(new DateTime(2016, 1, 1)), GetTimestamp(new DateTime(2016, 1, 1)), 1, 1, null, 1, 0.8m, 1, "Test" },
            }));

            // act
            var result = client.GetFundingCredits("Test");

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }
Beispiel #21
0
        public void GetActiveOrders_Should_RespondWithActiveOrders()
        {
            // arrange
            var expected = new[]
            {
                new BitfinexOrder()
                {
                    Amount               = 0.1m,
                    Price                = 0.2m,
                    Id                   = 1,
                    Status               = OrderStatus.Active,
                    Type                 = OrderType.ExchangeFillOrKill,
                    Symbol               = "test",
                    AmountOriginal       = 0.3m,
                    ClientOrderId        = 2,
                    Flags                = 0,
                    GroupId              = null,
                    Hidden               = false,
                    Notify               = false,
                    PlacedId             = 3,
                    PriceAuxilliaryLimit = 0,
                    PriceAverage         = 0.4m,
                    PriceTrailing        = 0.5m,
                    TimestampCreated     = new DateTime(2017, 1, 1),
                    TimestampUpdated     = new DateTime(2017, 1, 1),
                    TypePrevious         = null
                },
                new BitfinexOrder()
                {
                    Amount               = 0.6m,
                    Price                = 0.7m,
                    Id                   = 4,
                    Status               = OrderStatus.Active,
                    Type                 = OrderType.Limit,
                    Symbol               = "test",
                    AmountOriginal       = 0.8m,
                    ClientOrderId        = 5,
                    Flags                = 0,
                    GroupId              = null,
                    Hidden               = false,
                    Notify               = false,
                    PlacedId             = 6,
                    PriceAuxilliaryLimit = 0,
                    PriceAverage         = 0.9m,
                    PriceTrailing        = 1.1m,
                    TimestampCreated     = new DateTime(2016, 1, 1),
                    TimestampUpdated     = new DateTime(2016, 1, 1),
                    TypePrevious         = null
                }
            };
            var client = PrepareClient(JsonConvert.SerializeObject(new object[]
            {
                new object[] { 1, null, 2, "test", GetTimestamp(new DateTime(2017, 1, 1)), GetTimestamp(new DateTime(2017, 1, 1)), 0.1m, 0.3m, "EXCHANGE FOK", null, null, null, 0, "ACTIVE", null, null, 0.2m, 0.4m, 0.5m, 0, null, null, null, 0, 0, 3 },
                new object[] { 4, null, 5, "test", GetTimestamp(new DateTime(2016, 1, 1)), GetTimestamp(new DateTime(2016, 1, 1)), 0.6m, 0.8m, "LIMIT", null, null, null, 0, "ACTIVE", null, null, 0.7m, 0.9m, 1.1m, 0, null, null, null, 0, 0, 6 },
            }));

            // act
            var result = client.GetActiveOrders();

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[0], result.Data[0]));
            Assert.IsTrue(ObjectComparer.PublicInstancePropertiesEqual(expected[1], result.Data[1]));
        }