2023-05-11 10:50:07 +03:00
|
|
|
package accounts
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2023-05-28 12:40:50 +02:00
|
|
|
func MockTestAccounts(t *testing.T, db *sql.DB, accounts []*Account) {
|
2023-05-11 10:50:07 +03:00
|
|
|
d, err := NewDB(db)
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
2023-05-24 09:32:11 +02:00
|
|
|
err = d.SaveOrUpdateAccounts(accounts)
|
2023-05-11 10:50:07 +03:00
|
|
|
require.NoError(t, err)
|
|
|
|
res, err := d.GetAccounts()
|
|
|
|
require.NoError(t, err)
|
2023-06-02 09:38:06 +02:00
|
|
|
require.Equal(t, accounts[0].Address, res[0].Address)
|
2023-05-11 10:50:07 +03:00
|
|
|
}
|