Skip to content

CodeAction testing infrastructure does not behave hte same as VS wrt EquivalenceKey #44553

@CyrusNajmabadi

Description

@CyrusNajmabadi

See #44549 as an example of an issue caused by this.

We have a code-fixer "Generate constructor" which can produce up to two actions to fix a diagnostic. specifically:

  1. Generate constructor
  2. Generate constructor (without fields)

This feature has unit tests validating it works and that you should get both of these (and how each individually works).

However, hte actual VS product only shows the first item due to the second having the same equivalence-key as the first (null) and being produced by the same fixer for the same diagnostic.

--

This demonstrates a test hole we have. The tests are supposed to mimic the user behavior and validate what hte user sees and what happens when the user invokes particular options presented ot htem. In this case, because the code fix service does not show the second fix, the test should act as though only one fix is made available and should throw for tests that try to invoke the second fix.

Metadata

Metadata

Assignees

Labels

4 - In ReviewA fix for the issue is submitted for review.Area-IDE

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions