Skip to content

Commit

Permalink
Fix sync batch method coverage (Azure#17343)
Browse files Browse the repository at this point in the history
* fix sync batch method coverage
  • Loading branch information
christothes authored and annelo-msft committed Feb 17, 2021
1 parent 8a55d3c commit c85264e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected TableTransactionalBatch() { }
public virtual void DeleteEntity(string partitionKey, string rowKey, Azure.ETag ifMatch = default(Azure.ETag)) { }
public virtual Azure.Response<Azure.Data.Tables.Models.TableBatchResponse> SubmitBatch(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.Tables.Models.TableBatchResponse>> SubmitBatchAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public bool TryGetFailedEntityFromException(Azure.RequestFailedException exception, out Azure.Data.Tables.ITableEntity failedEntity) { throw null; }
public virtual bool TryGetFailedEntityFromException(Azure.RequestFailedException exception, out Azure.Data.Tables.ITableEntity failedEntity) { throw null; }
public virtual void UpdateEntity<T>(T entity, Azure.ETag ifMatch, Azure.Data.Tables.TableUpdateMode mode = Azure.Data.Tables.TableUpdateMode.Merge) where T : class, Azure.Data.Tables.ITableEntity, new() { }
public virtual void UpsertEntity<T>(T entity, Azure.Data.Tables.TableUpdateMode mode = Azure.Data.Tables.TableUpdateMode.Merge) where T : class, Azure.Data.Tables.ITableEntity, new() { }
}
Expand Down
2 changes: 0 additions & 2 deletions sdk/tables/Azure.Data.Tables/src/TableRestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
Expand Down
4 changes: 2 additions & 2 deletions sdk/tables/Azure.Data.Tables/src/TableTransactionalBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected TableTransactionalBatch()
/// </summary>
/// <param name="batchGuid">The batch boundary Guid.</param>
/// <param name="changesetGuid">The changeset boundary Guid.</param>
internal void SetBatchGuids(Guid batchGuid, Guid changesetGuid)
internal virtual void SetBatchGuids(Guid batchGuid, Guid changesetGuid)
{
_batchGuid = batchGuid;
_changesetGuid = changesetGuid;
Expand Down Expand Up @@ -256,7 +256,7 @@ internal async Task<Response<TableBatchResponse>> SubmitBatchAsyncInternal(bool
/// <param name="exception">The exception thrown from <see cref="TableTransactionalBatch.SubmitBatch(CancellationToken)"/> or <see cref="TableTransactionalBatch.SubmitBatchAsync(CancellationToken)"/>.</param>
/// <param name="failedEntity">If the return value is <c>true</c>, contains the <see cref="ITableEntity"/> that caused the batch operation to fail.</param>
/// <returns><c>true</c> if the failed entity was retrieved from the exception, else <c>false</c>.</returns>
public bool TryGetFailedEntityFromException(RequestFailedException exception, out ITableEntity failedEntity)
public virtual bool TryGetFailedEntityFromException(RequestFailedException exception, out ITableEntity failedEntity)
{
failedEntity = null;

Expand Down
6 changes: 3 additions & 3 deletions sdk/tables/Azure.Data.Tables/tests/TableClientLiveTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ public async Task BatchInsert()
var entitiesToCreate = CreateCustomTableEntities(PartitionKeyValue, 5);

// Create the batch.
var batch = client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey);
var batch = InstrumentClient(client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey));

batch.SetBatchGuids(Recording.Random.NewGuid(), Recording.Random.NewGuid());

Expand Down Expand Up @@ -1019,7 +1019,7 @@ public async Task BatchInsertAndMergeAndDelete()
await client.AddEntityAsync(entitiesToCreate[2]).ConfigureAwait(false);

// Create the batch.
TableTransactionalBatch batch = client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey);
TableTransactionalBatch batch = InstrumentClient(client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey));

batch.SetBatchGuids(Recording.Random.NewGuid(), Recording.Random.NewGuid());

Expand Down Expand Up @@ -1076,7 +1076,7 @@ public async Task BatchError()
var entitiesToCreate = CreateCustomTableEntities(PartitionKeyValue, 4);

// Create the batch.
var batch = client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey);
var batch = InstrumentClient(client.CreateTransactionalBatch(entitiesToCreate[0].PartitionKey));

batch.SetBatchGuids(Recording.Random.NewGuid(), Recording.Random.NewGuid());

Expand Down

0 comments on commit c85264e

Please sign in to comment.