public async Task DeleteAsync_Ok() { var resultTest = new ResultError(); var restClient = RestClientMock.DeleteRestClient(resultTest); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.DeleteAsync(); Assert.True(result.OkStatus); }
public async Task DeleteByIdAsync_Ok() { var test = TestTransferData.TestTransfers.First(); var resultTest = new ResultValue <TestTransfer>(test); var restClient = RestClientMock.DeleteRestClient(resultTest); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.DeleteAsync(test.Id); Assert.True(result.OkStatus); Assert.True(result.Value.Equals(test)); }
public async Task DeleteAsync_Error() { var error = ErrorTransferData.ErrorBadRequest; var resultTest = new ResultError(error); var restClient = RestClientMock.DeleteRestClient(resultTest); var testTransferConverter = TestTransferConverter; var testRestService = new TestRestService(restClient.Object, testTransferConverter); var result = await testRestService.DeleteAsync(); Assert.True(result.HasErrors); Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.BadRequest); }