Skip to content

Commit

Permalink
feat: run make mock and rename TransferTxAccount to TransferTx
Browse files Browse the repository at this point in the history
  • Loading branch information
cukhoaimon committed Feb 28, 2024
1 parent 540c2ec commit 811ef69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions internal/delivery/http/mock/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions internal/usecase/sqlc/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require"
)

func TestStore_TransferTxAccount(t *testing.T) {
func TestStore_TransferTx(t *testing.T) {
store := NewStore(testDB)

wantFromAccount := createRandomAccount(t)
Expand All @@ -21,7 +21,7 @@ func TestStore_TransferTxAccount(t *testing.T) {

for i := 0; i < n; i++ {
go func() {
result, err := store.TransferTxAccount(context.Background(), TransferTxParams{
result, err := store.TransferTx(context.Background(), TransferTxParams{
FromAccountID: wantFromAccount.ID,
ToAccountID: wantToAccount.ID,
Amount: amount,
Expand Down Expand Up @@ -115,7 +115,7 @@ func TestStore_TransferTxAccount(t *testing.T) {
require.Equal(t, wantToAccount.Balance+int64(n)*amount, updatedAccount2.Balance)
}

func TestStore_TransferTxAccountDeadLock(t *testing.T) {
func TestStore_TransferTxDeadLock(t *testing.T) {
store := NewStore(testDB)

wantFromAccount := createRandomAccount(t)
Expand All @@ -135,7 +135,7 @@ func TestStore_TransferTxAccountDeadLock(t *testing.T) {
}

go func() {
_, err := store.TransferTxAccount(context.Background(), TransferTxParams{
_, err := store.TransferTx(context.Background(), TransferTxParams{
FromAccountID: fromAccountID,
ToAccountID: toAccountID,
Amount: amount,
Expand Down

0 comments on commit 811ef69

Please sign in to comment.