Documentation ¶
Index ¶
- func AssertNoRequestsMade(t *testing.T, mock *MockDynamo, msg string, f func())
- func AssertRequestMade(t *testing.T, mock *MockDynamo, msg string, f func())
- func NewMockDynamo(tables []string) dynamodbiface.DynamoDBAPI
- type DataAccessLayer
- type MockDynamo
- func (d *MockDynamo) GetItem(in *dynamodb.GetItemInput) (out *dynamodb.GetItemOutput, err error)
- func (d *MockDynamo) PutItem(in *dynamodb.PutItemInput) (out *dynamodb.PutItemOutput, err error)
- func (d *MockDynamo) ScanPages(in *dynamodb.ScanInput, pager func(*dynamodb.ScanOutput, bool) bool) (err error)
- func (d *MockDynamo) UpdateItem(in *dynamodb.UpdateItemInput) (out *dynamodb.UpdateItemOutput, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoRequestsMade ¶
func AssertNoRequestsMade(t *testing.T, mock *MockDynamo, msg string, f func())
AssertNoRequestsMade will Execute a function, asserting that no requests are made over the course of the function.
func AssertRequestMade ¶
func AssertRequestMade(t *testing.T, mock *MockDynamo, msg string, f func())
AssertRequestMade will Execute a function, asserting that at least one request is made over the course of the function.
func NewMockDynamo ¶
func NewMockDynamo(tables []string) dynamodbiface.DynamoDBAPI
NewMockDynamo gets a dynamo interface for testing
Types ¶
type DataAccessLayer ¶
DataAccessLayer is an autogenerated mock type for the DataAccessLayer type
func (*DataAccessLayer) Find ¶
func (_m *DataAccessLayer) Find(filter interface{}) ([]map[string]interface{}, error)
Find provides a mock function with given fields: filter
type MockDynamo ¶
type MockDynamo struct { dynamodbiface.DynamoDBAPI // contains filtered or unexported fields }
MockDynamo mocks the DynamoDB API in memory. It only supports GetItem, PutItem, and ScanPages. It only supports the most simple filter expressions: they must be of the form <column> <operator> :<value>, and operator must be =, <, <=, >, >=, or <>.
func (*MockDynamo) GetItem ¶
func (d *MockDynamo) GetItem(in *dynamodb.GetItemInput) (out *dynamodb.GetItemOutput, err error)
GetItem mocks the dynamo GetItem method
func (*MockDynamo) PutItem ¶
func (d *MockDynamo) PutItem(in *dynamodb.PutItemInput) (out *dynamodb.PutItemOutput, err error)
PutItem mocks the dynamo PutItem method
func (*MockDynamo) ScanPages ¶
func (d *MockDynamo) ScanPages(in *dynamodb.ScanInput, pager func(*dynamodb.ScanOutput, bool) bool) (err error)
ScanPages mocks the dynamo ScanPages method
func (*MockDynamo) UpdateItem ¶
func (d *MockDynamo) UpdateItem(in *dynamodb.UpdateItemInput) (out *dynamodb.UpdateItemOutput, err error)
UpdateItem mocks the dynamo UpdateItem method