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

Force an open connection #22

Open
heynineteen opened this issue Feb 16, 2021 · 1 comment
Open

Force an open connection #22

heynineteen opened this issue Feb 16, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@heynineteen
Copy link

Currently, a command can be executed against a closed connection and that command will succeed. Suggest simulating the real behavior of DbConnections which would throw a System.InvalidOperationException unless the connection is open.

@dvoituron
Copy link
Contributor

For the moment, we do not actually use the connection status to be able to use it. The objective is to simulate the data returns during a call to an SQL database.

But it is an interesting feature.
I propose to add an option to MockDbConnection allowing to trigger an exception when the connection state is not "open".

@dvoituron dvoituron added the enhancement New feature or request label Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants