Questions tagged [fakexrmeasy]

Use this when using FakeXrmEasy to mock any .net code for testing against Microsoft Dynamics CRM 2011+

FakeXrmEasy is an open source automated testing framework specifically designed for Dynamics CRM versions 2011, 2013, 2015 and 2016.

For more information check FakeXrmEasy website

16 questions
4
votes
1 answer

FakeXRMEasy: Using AddFakeMessageExecutor to override update request behaviour

I am trying to create a test for a situation where an Update request throws an exception. Is this possible to do using FakeXRMEasy? I have tried using AddFakeMessageExecutor, but at the moment it is not working: My fake message executor…
2
votes
3 answers

creating linked data with fakexrmeasy

How do you create an entity and link another entity to it in FakeXrmEasy? I am attempting to test this code: public List GetTasks(Guid workOrderGuid) { var result = (from task in _xrmServiceContext.abc_OrderTaskSet …
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
1
vote
1 answer

Fake Xrm Easy: How to emulate a plugin's behaviour on orgService.Create()?

Microsoft Dynamics CRM 2015. I test Asp.Net Core controller's action. When I create new Lead record some plugin generates new Guid for lead.new_master_id field (it's type is string). Therefore after creating I retrive the record to get it's…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
1
vote
2 answers

CRM using ILMerge to merge framework library with plugin projects

I have two assemblies: Main plugin assembly - Plugin used for my project Framework assembly - I want to merge this assembly with the main plugin so I can reuse some common methods used a lot in different projects. I installed ILMerge on the main…
Master Yoda
  • 4,334
  • 10
  • 43
  • 77
1
vote
2 answers

Get ALL Entity Metadata in Dynamics CRM

What I want to do is: Retrieve all metadata from CRM. Serialize that metadata and store it in a file. At a later point, deserialize and eed that metadata to XrmFakeEasy for unit tests. Steps 2 and 3 are done but I don't know how to accomplish step…
Jay
  • 3,373
  • 6
  • 38
  • 55
1
vote
2 answers

Is there a way how to automatically force plugin execution

I want the plugins to trigger automatically. Does the FakeXrmEasy support this ? I tried following - plugin: public class Foo : IPlugin { public void Execute(IServiceProvider serviceProvider) { // never breaks…
Ondrej Svejdar
  • 21,349
  • 5
  • 54
  • 89
1
vote
1 answer

Dynamics 365 money fields base currency recalculation in fakexrmeasy unit tests

I'm new to Dynamics 365 and started recently to test my code using fake XRM. I've just run into a problem related to calculations done on currency (Money) fields, for which additional field is being created (which name ends with '_Base'). In unit…
A.D.
  • 425
  • 3
  • 15
1
vote
4 answers

How to refactor method to replace OrganizationServiceProxy with IOrganizationService

I'm attempting to refactor my code so that I can unit test using fakexrmeasy. As part of the suggested refactor mentioned here, I've attempted to pass IOrganizationService into all of my classes and methods. However, some of my classes use variables…
1
vote
2 answers

Dynamics 365 FakeXrm "usersettings" entity error

I have this piece of code in my Dynamics 365 plugin, private int? RetrieveCurrentUsersSettings(IOrganizationService service) { var currentUserSettings = service.RetrieveMultiple( new QueryExpression("usersettings") …
VolcanoAsh
  • 11
  • 3
0
votes
1 answer

'XrmFakedContext' does not cointain a definition for 'ExecutePluginWith'

I'm trying to upgrade a unit test project to the latest version of FakeXrmEasy 2.1.2 and I'm getting the error below: 'XrmFakedContext' does not cointain a definition for 'ExecutePluginWith' and no accessible extension method 'ExecutePluginWith'…
0
votes
0 answers

Mocking ExecuteMultipleResponse

is there any way to mock ExecuteMultipleResponse class? At the moment I am trying to write unit test using Fake Xrm Easy, but i am getting the following error: FakeXrmEasy.Abstractions.Exceptions.PullRequestException: 'Exception: The organization…
0
votes
1 answer

ExecuteMultipleResponse Dynamics CRM Unit tests error

Currently I am trying to write tests for Dynamics CRM app using Fake XRM Easy. This code gives me an error. var executeMultiple = new ExecuteMultipleRequest { Settings = new ExecuteMultipleSettings …
0
votes
2 answers

Linq query returning erroneous record from FakeXrmEasy context

I'm new to the world of FakeXrmEasy and trying to implement some unit tests in large existing code base written by another team :) I have an entity set in OnPremise DynamicsCRM app where the entity has the following…
PAblo
  • 39
  • 5
0
votes
1 answer

How to query for linked notes?

I've got a method that will link an annotation to a sales order: /// Links. /// Unique identifier for the note. /// Unique identifier for the…
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
0
votes
0 answers

How to add annotation to an entity?

I am attempting to write a unit test for this method: public List GetNotesByOrderGuid(Guid orderGuid) { var result = _xrmServiceContext.SalesOrderSet.Where(x => x.Id == orderGuid); //!!!!! this is returning correctly 1…
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
1
2