Skip to content

Misleading exception message: "FluentAssertions was configured to use mstest but the required test framework assembly could not be found" #1359

@fcastells

Description

@fcastells

Description

Configuring a not supported test framework in app config (eg "mstest" instead of "mstestv2") through FluentAssertions.TestFramework key throws a misleading exception message, which says:

"FluentAssertions was configured to use mstest but the required test framework assembly could not be found"

When it should say something like

string.Format("FluentAssertions was configured to use {0} but this test framework is not supported. Use one of the supported frameworks:  {1}",  frameworkName, string.Join(", ", Frameworks.Keys));

Complete minimal example reproducing the issue

Add the following to app.config:

 <add key="FluentAssertions.TestFramework" value="mstest" />

Add a failing test:

true.Should().BeFalse();

Expected behavior:

Message saying that the configured test framework is not supported and list the supported ones

Actual behavior:

Message saying that the test framework assembly could not be found (which leads to reviwing if the assembly is there, etc).

Versions

.net 462
FluentAssertions version 5.10.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions