sqs-browse: started working on tests for controllers

This commit is contained in:
Leon Mika 2022-03-24 08:49:09 +11:00
parent fb749aaee2
commit 43680000a8
14 changed files with 305 additions and 39 deletions

View file

@ -54,6 +54,7 @@ func (s *Service) Scan(ctx context.Context, table string) (*models.ResultSet, er
models.Sort(results, pk, sk)
return &models.ResultSet{
Table: table,
Columns: columns,
Items: results,
}, nil

View file

@ -24,6 +24,7 @@ func TestService_Scan(t *testing.T) {
assert.NoError(t, err)
// Hash first, then range, then columns in alphabetic order
assert.Equal(t, rs.Table, tableName)
assert.Equal(t, rs.Columns, []string{"pk", "sk", "alpha", "beta", "gamma"})
assert.Equal(t, rs.Items[0], testdynamo.TestRecordAsItem(t, testData[1]))
assert.Equal(t, rs.Items[1], testdynamo.TestRecordAsItem(t, testData[0]))