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
InvalidPluginExecutionException Exceptions not thrown in Pipeline Simulation #85
InvalidPluginExecutionException Exceptions not thrown in Pipeline Simulation #85
Comments
Here's a bit more detail before I upload the tests in case I'm not clear. When a plugin throws an invalid plugin exception, I'd expect to be able to write a test like this, where I'm just performing the Create in order to trigger the plugin and the exception: but this test fails because the exception that gets thrown is actually a TargetInvocationException. This test works though - so if I call the plugin directly it works: |
I have faced the same issue this Monday |
I created this pull request in the samples project to demonstrate the issue: |
This made it to this version: https://www.nuget.org/packages/FakeXrmEasy.Plugins.v9/2.3.2#release-body-tab |
When testing a plugin using Pipeline Simulation, if the plugin throws an InvalidPluginExecutionException this is not caught in the test.
If I test the plugin itself using ExecutePluginWith, the exception is caught in the test, but if I perform a CRUD operation in which the plugin is invoked, the test reports a different exception (System.Reflection.TargetInvocationException) and error message ('Exception has been thrown by the target of an invocation.')
I will create a failing test to demonstrate the issue....
The text was updated successfully, but these errors were encountered: