I was trying to write a unit test using a nested filter with ConditionOperator.Null using the latest version of FakeXrmEasy.9 (currently is this v1.57.1). I noticed that the test was not working because of the ConditionOperator.Null in the nestedfilter. Once I downgrade the FakeXrmEasy.9 version to v.1.51.0, the test was successfully. In all later versions the test will fail.
In my program, there are 2 Entities: Person and Employment. An employment is linked to a person and has a startdate/enddate.
Here is the query, I am using:
var query = new QueryExpression { EntityName = Person.EntityLogicalName, LinkEntities = { new LinkEntity { LinkFromEntityName = Person.EntityLogicalName, LinkFromAttributeName = Person.AttributeLogicalNames.Id, LinkToEntityName = Employment.EntityLogicalName, LinkToAttributeName = Employment.AttributeLogicalNames.PersonId, JoinOperator = JoinOperator.Inner, EntityAlias = Employment.EntityLogicalName, Columns = new ColumnSet( Employment.AttributeLogicalNames.Id, Employment.AttributeLogicalNames.StartDate ), LinkCriteria = new FilterExpression { Filters = { new FilterExpression(LogicalOperator.And) { Conditions = { new ConditionExpression(Employment.AttributeLogicalNames.EndDate, ConditionOperator.Null) } } } } } } };
I expect that a person with an employment with an empty enddate (enddate is null) will be filtered, but the test fails. There are no results when retrieving this query.
The file with the demo code can be found here. There, you will see that the test is not working. If you downgrade the project to FakeXrmEasy.9 to version 1.51.0, then you will see that the test is successfully.
FakeXrmEasy versions:
1.50.0 => works successfully
1.51.0 => works successfully
1.51.1 => Not working anymore
1.51.2 => Not working anymore
All later versions => Not working anymore
I was trying to write a unit test using a nested filter with ConditionOperator.Null using the latest version of FakeXrmEasy.9 (currently is this v1.57.1). I noticed that the test was not working because of the ConditionOperator.Null in the nestedfilter. Once I downgrade the FakeXrmEasy.9 version to v.1.51.0, the test was successfully. In all later versions the test will fail.
In my program, there are 2 Entities: Person and Employment. An employment is linked to a person and has a startdate/enddate. Here is the query, I am using:
var query = new QueryExpression { EntityName = Person.EntityLogicalName, LinkEntities = { new LinkEntity { LinkFromEntityName = Person.EntityLogicalName, LinkFromAttributeName = Person.AttributeLogicalNames.Id, LinkToEntityName = Employment.EntityLogicalName, LinkToAttributeName = Employment.AttributeLogicalNames.PersonId, JoinOperator = JoinOperator.Inner, EntityAlias = Employment.EntityLogicalName, Columns = new ColumnSet( Employment.AttributeLogicalNames.Id, Employment.AttributeLogicalNames.StartDate ), LinkCriteria = new FilterExpression { Filters = { new FilterExpression(LogicalOperator.And) { Conditions = { new ConditionExpression(Employment.AttributeLogicalNames.EndDate, ConditionOperator.Null) } } } } } } };
I expect that a person with an employment with an empty enddate (enddate is null) will be filtered, but the test fails. There are no results when retrieving this query.
The file with the demo code can be found here. There, you will see that the test is not working. If you downgrade the project to FakeXrmEasy.9 to version 1.51.0, then you will see that the test is successfully.
FakeXrmEasy versions: 1.50.0 => works successfully 1.51.0 => works successfully 1.51.1 => Not working anymore 1.51.2 => Not working anymore All later versions => Not working anymore