From ab2816a82ada1dce3ecd6d4f222dee747d253de5 Mon Sep 17 00:00:00 2001
From: Malhar Khimsaria <96malhar@gmail.com>
Date: Tue, 6 Aug 2024 10:26:31 -0700
Subject: [PATCH 1/7] Add the ability to mock BatchGet and MultiTableBatchGet
operations (#3407)
---
.../DynamoDBv2/Custom/DataModel/BatchGet.cs | 305 ++++++++----------
.../DynamoDBv2/Custom/DataModel/Context.cs | 38 +--
.../Custom/DataModel/IDynamoDBContext.cs | 15 +-
.../Custom/DataModel/_async/BatchGet.Async.cs | 47 ++-
.../Custom/DataModel/_async/Context.Async.cs | 28 +-
.../_async/IDynamoDBContext.Async.cs | 13 +-
.../Custom/DataModel/_bcl/BatchGet.Sync.cs | 47 ++-
.../Custom/DataModel/_bcl/Context.Sync.cs | 13 +-
.../DataModel/_bcl/IDynamoDBContext.Sync.cs | 4 +-
.../Custom/MockabilityTests/BatchGetTests.cs | 167 ++++++++++
10 files changed, 384 insertions(+), 293 deletions(-)
create mode 100644 sdk/test/Services/DynamoDBv2/UnitTests/Custom/MockabilityTests/BatchGetTests.cs
diff --git a/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGet.cs b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGet.cs
index 29379dd4a929..7dae11417f1c 100644
--- a/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGet.cs
+++ b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGet.cs
@@ -14,11 +14,9 @@
*/
using System;
-using System.Collections;
using System.Collections.Generic;
-using System.Reflection;
-using Amazon.DynamoDBv2.Model;
using Amazon.DynamoDBv2.DocumentModel;
+
#if AWS_ASYNC_API
using System.Threading.Tasks;
#endif
@@ -27,163 +25,151 @@
namespace Amazon.DynamoDBv2.DataModel
{
///
- /// Represents a non-generic object for retrieving a batch of items
+ /// Represents a non-generic interface for retrieving a batch of items
/// from a single DynamoDB table
///
- public abstract partial class BatchGet
+ public partial interface IBatchGet
{
- #region Internal/protected properties
-
///
- /// Gets and sets the UntypedResults property.
+ /// Returns the total number of keys associated with this Batch request.
///
- protected List