Skip to content

Add support for Span and ReadOnlySpan #902

@sergey-rybalkin

Description

@sergey-rybalkin

Description

Add support for Span and ReadOnlySpan. Though they do not directly implement IEnumerable<T> interface it would be nice to be able to assert using NotContain etc.

Complete minimal example reproducing the issue

// Arrange
ReadOnlySpan<string> span = new ReadOnlySpan<string>(new[] {"a", "b", "c"});

// Act
span = span.Slice(1);

// Assert
span.Should().NotContain("a");

Expected behavior:

Test should pass.

Actual behavior:

Compilation error saying extension method Should does not exist for ReadOnlySpan.

Versions

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

Metadata

Metadata

Assignees

Labels

api-suggestionEarly API idea and discussion, it is NOT ready for implementationfeature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions