src/SFBulkAPIStarterTest/TestBulkApiClient.cs
/// <summary>
/// Tests creating an insert account job with one batch with one account in it.
/// </summary>
Tests creating an insert account job with one batch with one account in it.
Tests creating an insert account job with one batch with one account in it .
[TestMethod]
        public void InsertAccountsWith1BatchTest()
        {
            CreateJobRequest insertAccountJobRequest = buildDefaultInsertAccountCreateJobRequest();
            Job insertAccountJob = _apiClient.CreateJob(insertAccountJobRequest);
            String batchContents = buildDefaultAccountBatchContents();
            CreateBatchRequest insertAccountBatchRequest = buildCreateBatchRequest(insertAccountJob.Id, batchContents);
            Batch accountBatch = _apiClient.CreateBatch(insertAccountBatchRequest);
            Assert.IsTrue(accountBatch != null);
            Assert.IsTrue(String.IsNullOrWhiteSpace(accountBatch.Id) == false);
            _apiClient.CloseJob(insertAccountJob.Id);
            insertAccountJob = _apiClient.GetCompletedJob(insertAccountJob.Id);
            Assert.IsTrue(insertAccountJob.NumberRecordsFailed == 0);
            Assert.IsTrue(insertAccountJob.NumberRecordsProcessed == 1);
        }
[ TestMethod ] public void InsertAccountsWith1BatchTest ( ) { CreateJobRequest insertAccountJobRequest = buildDefaultInsertAccountCreateJobRequest ( ) ; Job insertAccountJob = _apiClient . CreateJob ( insertAccountJobRequest ) ; String batchContents = buildDefaultAccountBatchContents ( ) ; CreateBatchRequest insertAccountBatchRequest = buildCreateBatchRequest ( insertAccountJob . Id , batchContents ) ; Batch accountBatch = _apiClient . CreateBatch ( insertAccountBatchRequest ) ; Assert . IsTrue ( accountBatch != null ) ; Assert . IsTrue ( String . IsNullOrWhiteSpace ( accountBatch . Id ) == false ) ; _apiClient . CloseJob ( insertAccountJob . Id ) ; insertAccountJob = _apiClient . GetCompletedJob ( insertAccountJob . Id ) ; Assert . IsTrue ( insertAccountJob . NumberRecordsFailed == 0 ) ; Assert . IsTrue ( insertAccountJob . NumberRecordsProcessed == 1 ) ; }
Tests creating an insert account job with one batch with one account in it.
Tests creating an insert account job with one batch with one account in it .
// Close job so no more batches are added.