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

#1093: Update stock quantity bug #1094

Merged
merged 3 commits into from Mar 17, 2024
Merged

#1093: Update stock quantity bug #1094

merged 3 commits into from Mar 17, 2024

Conversation

s04v
Copy link
Contributor

@s04v s04v commented Mar 12, 2024

Fix #1093

@hishamco
Copy link
Member

A unit test will be useful to ensure nothing broken in this case

@s04v
Copy link
Contributor Author

s04v commented Mar 12, 2024

Hello, @hishamco, there is a fully commented out StockServiceTests.cs file . Should I create a new file for the tests?

@hishamco
Copy link
Member

Seems it's commented :) you can uncomment the class and add your test cases, leave everything as it was

@hishamco
Copy link
Member

Why you are using MockQueryable.Moq

@s04v
Copy link
Contributor Author

s04v commented Mar 13, 2024

Because the FirstOrDefaultAsync method is used in UpdateStock. Calling FirstOrDefaultAsync with Moq throws an exception that this method works only with IAsyncQueryProvider. MockQueryable.Moq helps to solve it

@hishamco
Copy link
Member

I see, let me do a quick check today then merge

Thanks

@s04v
Copy link
Contributor Author

s04v commented Mar 15, 2024

Any updates?

@hishamco
Copy link
Member

Sorry I was sick last few days, that's why I didn't give you an update

@s04v
Copy link
Contributor Author

s04v commented Mar 16, 2024

It's okay, take care of yourself.

@hishamco hishamco merged commit 64c00e2 into simplcommerce:master Mar 17, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

Update stock quantity bug
2 participants