Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sync batch method coverage #17343

Merged
merged 3 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -984,7 +984,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 @@ -1022,7 +1022,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 @@ -1079,7 +1079,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