Comments (5)
I'd think you shouldn't put too much onto responsibility of the single fake-xrm-easy NuGet package as unit testing and integration testing have quite different responsibilities. Another tests components as separate entities and another tests components as a part of the complete system.
I'd consider approach where current fake-xrm-easy functionality would be broken into two pars:
- IOrganizationService simulation would be in one separate NuGet package and
- Plugin and WF activity testing would be on separate NuGet package.
This would allow greater flexibility for community to build their own solution which might depend solely from IOrganizationService package. After these two are separated then I'd say integration tests could be implemented into separate NuGet package depending for example for those two.
from fake-xrm-easy.
Thanks a lot for your feedback @teppolainio
I get your point for integration testing and maybe is better to have a separete NuGet package for that.
I do like having Plugin and Codeactivity mocks into the one fakexrmeasy NuGet package tho, to keep maintenance of the project itself easier, and also, from a point of view of unit testing solely, it's just easier to add a single reference than adding 2 per unit test project.
What do you want to add which depends solely on the IOrganizationService?
from fake-xrm-easy.
Situation I was thinking about where dependancy only to IOrganizationService would be sufficient was testing of standalone applications which query and/or write data from/to CRM but are not run within CRM. Examples would be different kind of integration services, web services, Windows services, command line application, desktop applications etc.
Also, if my assumption is correct IOrganizationService mockup is implemented using "pure code" which does not have dependency to FakeItEasy mockup library whereas plugin and code activity execution parts of fake-xrm-easy are done using mockups i.e. they have dependancy to FakeItEasy. If this assumption is correct then separate NuGet package for IOrganizationService mockup would also make it possible to integrate it into existing unit test solution which might be built using some other mockup libraries (like NSubstitute). Please correct me if my assumption about FakeItEasy dependancy was incorrect.
Nevertheless, current fake-xrm-easy implementation doesn't incur too much unnecessary features to cases where only IOrganizationService mockup is sufficient that we couldn't handle it but adding also integration tests into the same NuGet package could mitigate usefullness and easy approachability of the current fake-xrm-easy unit testing library.
from fake-xrm-easy.
Dependency on FakeItEasy is at the core of FakeXrmEasy (in part, that was the reason it was named that way :) ).
If you look at this you'll see even really basic operations like CRUD, are also using FakeItEasy.
If you look at the codebase, the heavy work was around mocking the IOrganisationService, and the Plugin and CodeActivity mocks just add a little bit on top of that.
I totally agree though it doesn't make much sense to incorporate integration testing mocks here because in that case tests should be run against a real Organisation Service. I was thinking of initially adding them here to add some kind of helper logic to implement TearDown methods, which would clean all the testing data for you on the integration environment once the test is finished.
But after thinking a lot on it, I believe it is much more easier and safer to setup a VM environment where you will spin up a VM with a CRM integration test environment, execute integration tests, and stop it when done.
By doing that there won't any interference or clashes between integration test runs and therefore no need to worry about the data that was created there. Which is really key concept of TDD: tests should be Repeatable.
from fake-xrm-easy.
Hi @teppolainio
Iยดm going to close this if you are happy as it makes more sense to have a separate NuGet package for integration testing.
from fake-xrm-easy.
Related Issues (20)
- Fakecontext isn't updating after target change plugin executed HOT 1
- Query on associatedentitytypecode should work with both Entity Name and ObjectTypeCode HOT 5
- ConditionOperator.LessThan is throwing error "Specified Cast is not valid" for DateTimeField HOT 3
- NullReferenceException registering Plugin in simulated pipeline HOT 10
- RetrieveEntityDataSource is returning null value HOT 3
- Announcing public preview of FakeXrmEasy v2.x! HOT 1
- The specified service type is not supported when using Microsoft.Xrm.Sdk.PluginTelemetry. HOT 2
- Complex filter works in main entity, but not in nested entity.
- Is the Microsoft.PowerPlatform.Dataverse.Client supported? HOT 1
- ThisMonth in Query Expression fails on last day after midday
- ExecutePluginWith<T>(...) has no parameter for MessageName - need to use obselete method ExecutePluginWithTargetAndPreEntityImages<T>(...) HOT 2
- In Code Activity Logical Name does not exist HOT 1
- `type argument 'FakeXrmEasyUpdatePluginCrash.MyPlugin' violates the constraint of type parameter 'T'.` HOT 3
- Couldnt find reflected type for sdkmessageprocessingstepimage HOT 2
- ServiceClient not working with CrmServiceContext from Early Bound Generated Class HOT 2
- Object reference not set to an instance of an object.
- Filters with like condition throw 'Object reference not set to an instance of an object.'
- Add Support for ExecuteTransactionRequest
- Should support Operators where early bound types for a multi option set (i.e. multiple choice) is generated as an IEnumberable<TEnum> as opposed to an OptionSetValueCollection
- FetchXml StateCode Specified Cast is not Valid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fake-xrm-easy.