public void CancelPositionAsync_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.CancelPositionAsync("futures", 1, groupId: null)); //assert Assert.IsType <ArgumentException>(actual.Result); }
public void Construtcor_should_return_instance_2(ApiClientOption option) { //arrange //act var obj = new LeverageApi(option); //assert Assert.NotNull(obj); Assert.IsType <LeverageApi>(obj); }
public void Construtcor_should_return_instance_1(string apiKey, string apiSecret) { //arrange //act var obj = new LeverageApi(apiKey, apiSecret); //assert Assert.NotNull(obj); Assert.IsType <LeverageApi>(obj); }
public async void CancelPositionAsync_1_should_success(string jsonString, string type, int leverageId, int?groupId) { //arrange var response = TestHelper.CreateJsonResponse(jsonString); var obj = new LeverageApi(TestHelper.CreateApiClientWithMockHttpAccessor(response)); //act var actual = await obj.CancelPositionAsync(type, leverageId, groupId); //assert Assert.NotNull(actual); Assert.IsAssignableFrom <CancelPositionResponse>(actual); }
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); }
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); }
public async void CreatePositionAsync_should_success(string jsonString, string type, string currencyPair, string action, decimal amount, decimal price, decimal leverage, int?groupId, decimal?limit, decimal?stop) { //arrange var response = TestHelper.CreateJsonResponse(jsonString); var obj = new LeverageApi(TestHelper.CreateApiClientWithMockHttpAccessor(response)); //act var actual = await obj.CreatePositionAsync(type, currencyPair, action, amount, price, leverage, groupId, limit, stop); //assert Assert.NotNull(actual); Assert.IsAssignableFrom <CreatePositionResponse>(actual); }
public async void GetPositionsAsync_should_success(string jsonString, string type, int?groupId, int?from, int?count, int?fromId, int?endId, string order, long?since, long?end, string currencyPair) { //arrange var response = TestHelper.CreateJsonResponse(jsonString); var obj = new LeverageApi(TestHelper.CreateApiClientWithMockHttpAccessor(response)); //act var actual = await obj.GetPositionsAsync( type, groupId, from, count, fromId, endId, order, since, end, currencyPair); //assert Assert.NotNull(actual); Assert.IsAssignableFrom <IDictionary <int, GetPositionsResponse> >(actual); }