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
Automatic Registration in Pipeline Simulation expects SdkMessage, SdkMessageFilter, SdkMessageProcessingStep and PluginType when using early bound entities #95
Comments
Am I correct on assuming this requirement will be removed in future? It is kind of unintriguing that one needs to generate early bound classes for requirements by unit test mockup library. |
Great feedback @teppolainio ! I think we could also ship pre-generated early bound classes for these types SdkMessage, SdkMessageFilter, and so on, and automatically resolve them if not found in an assembly that was explicitly generated. How does that sound? |
Hypothesis: this might also happen if RegisterPluginStep is called after .Initialize or any other method that sets an Assembly with early bound types prior to RegisterPluginStep is called. |
@jordimontana82 I tested your hypothesesis and it seems to hold true. It would be great if one wouldn't have to add early bound classes for boilerplate entities just for the sake of mockup library. Could you for example ship some sort of metadata factory which could create necessary metadata for entities sdkmessage, sdkmessagefilter, sdkmessageprocessingstep and plugintype when these aren't included into those entities necessary for plugins application logic to run? Then you could hint on exception message something like "Metadata for entities these-and-these is required when using early bound classes. Either add these to your generated early-bound classes or add necessary metadata to FakeXrmEasy using ThisAwesomeMetadataFactory.CreateSomeBoilerplateEntityMetadata()" etc. Original run On test method on separate test class: Modified run number one On test method on separate test class: Modified run number two On test method on separate test class: |
I like that idea @teppolainio |
@teppolainio This made it to this version: https://www.nuget.org/packages/FakeXrmEasy.Plugins.v9/2.3.2#release-body-tab Slightly different approach in the end, it'll check if using early bound, and if so, search for all the needed types. If all of them are present in the user-defined assembly, it'll use those. Should cover all possible scenarios. |
…s to prevent DynamicsValue/fake-xrm-easy#95 after introducing secure configs in pipeline simulation.
Check if using early bound and if all of the above entities were generated along with other entities. If not, raise a dedicated exception as the current message is a bit broad and not specific: "Could not find reflected type for sdkmessage".
The text was updated successfully, but these errors were encountered: