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 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 void CancelPositionAsync_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" }, { "leverage_id", "0" } }; //act var actual = Record.ExceptionAsync(async() => await obj.CancelPositionAsync(parameters)); //assert Assert.IsType <ArgumentException>(actual.Result); }