public void GivenATableWithIndex(string tableName, string indexName, int indexRead, int indexWrite) { var tableDesc = new TableDescription { TableName = tableName, ProvisionedThroughput = new ProvisionedThroughputDescription { ReadCapacityUnits = indexRead, WriteCapacityUnits = indexWrite }, GlobalSecondaryIndexes = new List <GlobalSecondaryIndexDescription> { new GlobalSecondaryIndexDescription { IndexName = indexName, ProvisionedThroughput = new ProvisionedThroughputDescription { ReadCapacityUnits = indexRead, WriteCapacityUnits = indexWrite } } } }; var resource = new AwsResource <TableDescription>(tableName, tableDesc); TableLoader .Setup(x => x.GetResourceAsync(tableName)) .ReturnsAsync(resource); }
public void GivenATable(string tableName, int readCapacity, int writeCapacity) { var tableDesc = new TableDescription { TableName = tableName, ProvisionedThroughput = new ProvisionedThroughputDescription { ReadCapacityUnits = readCapacity, WriteCapacityUnits = writeCapacity } }; TableLoader .Setup(x => x.GetResourceAsync(tableName)) .ReturnsAsync(tableDesc); }
public void GivenAListOfTables(IEnumerable <string> tableNames) { TableLoader.Setup(x => x.GetResourceNamesAsync()) .ReturnsAsync(tableNames.ToList()); }
public void GivenATableDoesNotExist(string failureTable) { TableLoader .Setup(x => x.GetResourceAsync(failureTable)) .Throws(new AmazonDynamoDBException("The table does not exist")); }