Skip to content
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 @@ -26,8 +26,8 @@ public async Task TestTableOperations()
// Clear tables
await SharedTestFixture.CleanupTables();

Table hashTable;
Table hashRangeTable;
ITable hashTable;
ITable hashRangeTable;

// Load tables using provided conversion schema
LoadTables(conversion, out hashTable, out hashRangeTable);
Expand Down Expand Up @@ -64,7 +64,7 @@ public async Task TestTableOperations()
}
}

private async Task TestPagination(Table hashRangeTable)
private async Task TestPagination(ITable hashRangeTable)
{
var itemCount = 10;
var batchWrite = hashRangeTable.CreateBatchWrite();
Expand Down Expand Up @@ -136,7 +136,7 @@ private async Task TestPagination(Table hashRangeTable)
}
}

private static async Task<int> VerifyPagination(Search search, List<string> tokens)
private static async Task<int> VerifyPagination(ISearch search, List<string> tokens)
{
int count = 0;
do
Expand All @@ -156,7 +156,7 @@ private static async Task<int> VerifyPagination(Search search, List<string> toke
return count;
}

private async Task TestEmptyCollections(Table hashTable)
private async Task TestEmptyCollections(ITable hashTable)
{
Document doc = new Document();
doc["Id"] = 1;
Expand All @@ -179,7 +179,7 @@ private async Task TestEmptyCollections(Table hashTable)
Assert.Empty(listEntry.AsDynamoDBList().Entries);
}

private async Task TestHashTable(Table hashTable, DynamoDBEntryConversion conversion)
private async Task TestHashTable(ITable hashTable, DynamoDBEntryConversion conversion)
{
// Put an item
Document doc = new Document();
Expand Down Expand Up @@ -343,7 +343,7 @@ private async Task TestHashTable(Table hashTable, DynamoDBEntryConversion conver
items = await hashTable.Scan(new ScanFilter()).GetRemainingAsync();
Assert.Empty(items);
}
private async Task TestHashRangeTable(Table hashRangeTable, DynamoDBEntryConversion conversion)
private async Task TestHashRangeTable(ITable hashRangeTable, DynamoDBEntryConversion conversion)
{
// Put an item
Document doc1 = new Document();
Expand Down Expand Up @@ -556,7 +556,7 @@ private async Task TestHashRangeTable(Table hashRangeTable, DynamoDBEntryConvers
}).GetRemainingAsync();
Assert.Single(items);
}
private async Task TestLargeBatchOperations(Table hashTable)
private async Task TestLargeBatchOperations(ITable hashTable)
{
int itemCount = 30;
int itemSize = 40 * 1024;
Expand Down Expand Up @@ -604,7 +604,7 @@ private async Task TestLargeBatchOperations(Table hashTable)
Assert.Empty(items);
}

private async Task TestExpressionsOnDelete(Table hashTable)
private async Task TestExpressionsOnDelete(ITable hashTable)
{
Document doc1 = new Document();
doc1["Id"] = 13;
Expand All @@ -624,7 +624,7 @@ private async Task TestExpressionsOnDelete(Table hashTable)
await hashTable.DeleteItemAsync(doc1, config);
}

private async Task TestExpressionsOnQuery(Table hashRangeTable)
private async Task TestExpressionsOnQuery(ITable hashRangeTable)
{
Document doc1 = new Document();
doc1["Name"] = "Gunnar";
Expand Down Expand Up @@ -663,7 +663,7 @@ private async Task TestExpressionsOnQuery(Table hashRangeTable)
await hashRangeTable.DeleteItemAsync(doc2);
}

private async Task TestExpressionsOnScan(Table hashRangeTable)
private async Task TestExpressionsOnScan(ITable hashRangeTable)
{
await SharedTestFixture.ClearTable(SharedTestFixture.hashRangeTableName);

Expand Down Expand Up @@ -703,7 +703,7 @@ private async Task TestExpressionsOnScan(Table hashRangeTable)
await hashRangeTable.DeleteItemAsync(doc2);
}

private async Task TestExpressionPut(Table hashTable)
private async Task TestExpressionPut(ITable hashTable)
{
Document doc = new Document();

Expand Down Expand Up @@ -746,7 +746,7 @@ private async Task TestExpressionPut(Table hashTable)
await hashTable.DeleteItemAsync(doc);
}

private async Task TestExpressionUpdate(Table hashTable)
private async Task TestExpressionUpdate(ITable hashTable)
{
Document doc = new Document();

Expand Down Expand Up @@ -805,7 +805,7 @@ private bool AreValuesEqual(Document docA, Document docB, DynamoDBEntryConversio
return true;
return docA.Equals(docB);
}
private void LoadTables(DynamoDBEntryConversion conversion, out Table hashTable, out Table hashRangeTable)
private void LoadTables(DynamoDBEntryConversion conversion, out ITable hashTable, out ITable hashRangeTable)
{
SharedTestFixture.TableCache.Clear();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ private async Task TestPutGet()
// Clear tables
await SharedTestFixture.CleanupTables();

Table hashTable;
Table hashRangeTable;
ITable hashTable;
ITable hashRangeTable;

// Load tables using provided conversion schema
LoadTables(DynamoDBEntryConversion.V2, out hashTable, out hashRangeTable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private async Task DeleteTable(IAmazonDynamoDB dynamoDBClient, string tableName)
await dynamoDBClient.DeleteTableAsync(tableName);
}

private static async Task InsertData(Table table, string id, string body)
private static async Task InsertData(ITable table, string id, string body)
{
await table.PutItemAsync(new Document(new Dictionary<string, DynamoDBEntry>
{
Expand All @@ -378,7 +378,7 @@ await table.PutItemAsync(new Document(new Dictionary<string, DynamoDBEntry>
}));
}

private async Task<string> ReadData(Table table, string id)
private async Task<string> ReadData(ITable table, string id)
{
Document doc = await table.GetItemAsync(new Primitive(id));

Expand Down