20 lines
403 B
Go
20 lines
403 B
Go
package accounts
|
|
|
|
import (
|
|
"database/sql"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func MockTestAccounts(tb testing.TB, db *sql.DB, accounts []*Account) {
|
|
d, err := NewDB(db)
|
|
require.NoError(tb, err)
|
|
|
|
err = d.SaveOrUpdateAccounts(accounts, false)
|
|
require.NoError(tb, err)
|
|
res, err := d.GetAccounts()
|
|
require.NoError(tb, err)
|
|
require.Equal(tb, accounts[0].Address, res[0].Address)
|
|
}
|