Skip to content

Allow extension libraries to alter options before the first assertion #2290

@dennisdoomen

Description

@dennisdoomen

Extension libraries have typically two needs that are currently not provided:

  1. Being able to mark themselves as an extension library so that CallerIdentifier doesn't need to check for individual CustomAssertion attributes
  2. Being able to inject additional capabilities, like custom implementations of IEquivalencyStep such as provided by FluentAssertions.DataSets.

I'm proposing to introduce an assembly-level attribute that FA will scan for before it executes any kind of assertion. This attribute will point to an initialization class/method that can be used to change FA defaults, e.g. using AssertionOptions.

I'm not 100% sure yet, but I suspect this scanning could be triggered by the static constructor of AssertionExtensions

Is a prerequisite for finishing #2002

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions