コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void GivenAListOfTables(IEnumerable <string> tableNames)
 {
     TableLoader.Setup(x => x.GetResourceNamesAsync())
     .ReturnsAsync(tableNames.ToList());
 }
コード例 #4
0
 public void GivenATableDoesNotExist(string failureTable)
 {
     TableLoader
     .Setup(x => x.GetResourceAsync(failureTable))
     .Throws(new AmazonDynamoDBException("The table does not exist"));
 }