Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How mock sql many times? #240

Open
a1499418300 opened this issue Oct 21, 2020 · 1 comment
Open

How mock sql many times? #240

a1499418300 opened this issue Oct 21, 2020 · 1 comment

Comments

@a1499418300
Copy link

a1499418300 commented Oct 21, 2020

  • Hello, when I exec one sql many times, I got the error:
    --- FAIL: TestMysqlProxy_getItemByID (0.00s)
    --- FAIL: TestMysqlProxy_getItemByID/getItemByID_OK (0.00s)
    main_test.go:49: err: all expectations were already fulfilled, call to Query 'SELECT id, name FROM user where id = ?' with args [{Name: Ordinal:1 Value:1}] was not expected, got: {ID:0 Name:}
    main_test.go:51: MysqlProxy.getItemByID() error = all expectations were already fulfilled, call to Query 'SELECT id, name FROM user where id = ?' with args [{Name: Ordinal:1 Value:1}] was not expected, wantErr false

  • my code
    image

  • unit test code
    image

@yashschandra
Copy link

maybe #257 can help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants