Skip to content

Unexpected method call issue with golang mock unit testing #2106

Answered by aldas
SajaiPrathap070 asked this question in Q&A
Discussion options

You must be logged in to vote

I think that the problem is that
UpdateMainCategory(mainCategoryID string, mainCategory mongodb.MainCategory) (int64, error) takes 2 arguments

but mock prepares for one
database.On("UpdateMainCategory", tc.dBWhen).Return(tc.dBReturn, tc.dBError)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SajaiPrathap070
Comment options

Answer selected by SajaiPrathap070
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants