Skip to content

[Feature] - Count XDocument nodes #1681

@ITaluone

Description

@ITaluone

Before you file a bug, have you:

  • Tried upgrading to newest version of Fluent Assertions, to see if your issue has already been resolved and released?
  • Checked existing open and closed issues, to see if the issue has already been reported?
  • Tried reproducing your problem in a new isolated project?
  • Read the documentation?
  • Considered if this is a general question and not a bug?. For general questions please use StackOverflow.

Description

It would be great if you can count occurrences of XML nodes.
Reason is: According to the openTRANS standard various nodes have to be available exactly once.

Complete minimal example reproducing the issue

None, because the method does not exist :)

Expected behavior:

Intellisense shows something like:

  • xDoc.Should().HaveElement("element").**Single()**
    or
  • xDoc.Should().HaveElement("element").**And.HaveCount(3)**

Versions

  • Which version of Fluent Assertions are you using? 6.1.0
  • Which .NET runtime and version are you targeting? .NET Core 3.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions