Example #1
0
        public void ActivePositionsAsync_should_throw_ArgumentException_if_futures_group_id_is_null_1()
        {
            //arrange
            var obj = new LeverageApi(TestHelper.CreateApiClientWithMockHttpAccessor());

            //act
            var actual = Record.ExceptionAsync(async() => await obj.ActivePositionsAsync("futures", groupId: null));

            //assert
            Assert.IsType <ArgumentException>(actual.Result);
        }
Example #2
0
        public async void ActivePositionsAsync_should_success(string jsonString, string type, int?groupId, string currencyPair)
        {
            //arrange
            var response = TestHelper.CreateJsonResponse(jsonString);

            var obj = new LeverageApi(TestHelper.CreateApiClientWithMockHttpAccessor(response));

            //act
            var actual = await obj.ActivePositionsAsync(type, groupId, currencyPair);

            //assert
            Assert.NotNull(actual);
            Assert.IsAssignableFrom <IDictionary <int, ActivePositionsResponse> >(actual);
        }
Example #3
0
        public void ActivePositionsAsync_should_throw_ArgumentException_if_futures_group_id_is_null_2()
        {
            //arrange
            var obj        = new LeverageApi(TestHelper.CreateApiClientWithMockHttpAccessor());
            var parameters = new Dictionary <string, string>
            {
                { "type", "futures" }
            };

            //act
            var actual = Record.ExceptionAsync(async() => await obj.ActivePositionsAsync(parameters));

            //assert
            Assert.IsType <ArgumentException>(actual.Result);
        }