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

13 questions
3
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
  • 51,480
  • 273
  • 609
  • 976
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
  • 2,827
  • 6
  • 34
  • 49
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.
  • 295
  • 2
  • 12
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
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
  • 3,966
  • 8
  • 34
  • 67
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
  • 37
  • 4
0
votes
0 answers

How to mock context in a Azure Function?

In Dynamics 365 (CE) there are ways to mock a plugin/workflow with XRMFakeEasy. But is there any similar way to mock a webhook (to a Azure Function)?
Kran
  • 63
  • 9
0
votes
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
  • 19,236
  • 4
  • 49
  • 77
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
  • 51,480
  • 273
  • 609
  • 976
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
  • 51,480
  • 273
  • 609
  • 976
0
votes
1 answer

Specified Cast Invalid

I am trying to retrospectively write some unit tests for code I inherited. One particular method is causing me problems within a Dynamics CRM 2011 plugin method with a LinkedEntity FilterCondition in a QueryExpression Structure of Entities Contact…
Mauro
  • 4,455
  • 3
  • 26
  • 54