Skip to content
Daryl LaBar edited this page Apr 16, 2020 · 3 revisions

Any time a breaking change will at least the minor number should be incremented. Below is a list of breaking changes and the fixes required.

2.3.0.1

DLaB.Xrm.Test.Builders.EntityBuilder has been renamed to DLaB.Xrm.Test.Builders.DLaBBuilder and an extra generic parameter has been added.

Why?

The extra parameter was added to allow any base implementation to return the most derived class type in fluent methods. Since this was a breaking change, it made sense to rename it as well so that any class inheriting it with the name EntityBuilder won't require a namespace to avoid name collisions.

Steps To Fix

Steps to resolve breaking changes

  1. Any class that inherits from DLaB.Xrm.Test.Builders.EntityBuilder will now need to be updated to inherit from DLaB.Xrm.Test.Builders.EntityBuilder. An extra type parameter that is defined as the type of the class itself must be added as well.
  2. The TestSettings.EntityBuilder.ConfigureDerivedAssembly normally is set to the custom project specific EntityBuilder. If so, it will need to be updated to a typed entity specific builder, since I don't think it's possible to pass in EntityBuilder<Entity,>.

Fix Examples - Before

EntityBuilder.cs - Or any class that would inherit from DLaB.Xrm.Test.Builders.EntityBuilder

   public abstract class EntityBuilder<TEntity> : DLaB.Xrm.Test.Builders.EntityBuilder<TEntity> where TEntity : Entity
   {

   }

ActionBuilder.cs - Or any class that would inherit from a base EntityBuilder

public class AccountBuilder : EntityBuilder<Account>
{
   ...
}

TestInitializer.cs

TestSettings.EntityBuilder.ConfigureDerivedAssembly<EntityBuilder<Entity>>();

Fix Examples - After

EntityBuilder.cs

    public abstract class EntityBuilder<TEntity, TBuilder> : DLaB.Xrm.Test.Builders.DLaBEntityBuilder<TEntity, TBuilder>
        where TBuilder : EntityBuilder<TEntity, TBuilder>
        where TEntity : Entity
    {

    }

ActionBuilder.cs

public class AccountBuilder : EntityBuilder<Account, AccountBuilder>
{
   ...
}

TestInitializer.cs

TestSettings.EntityBuilder.ConfigureDerivedAssembly<AccountBuilder>();
Clone this wiki locally