Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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 objects = TestHelpers.PrepareClient(() => Construct(new BitfinexClientOptions()
            {
                ApiCredentials = new ApiCredentials("Test", "Test")
            }), JsonConvert.SerializeObject(expected));

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

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(TestHelpers.PublicInstancePropertiesEqual(expected, result.Data));
        }
        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 = TestHelpers.CreateAuthenticatedResponseClient(expected);

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

            // assert
            Assert.AreEqual(true, result.Success);
            Assert.IsTrue(TestHelpers.AreEqual(expected, result.Data));
        }