Skip to content

Chaning multiple Contains() on a list assertion is not possible any more #3412

Description

@B3RR10

Previous to the overhaul of the Assertions, it was possible to assert multiple conditions on a list:

await Assert.That(myList).IsNotNull()
  .And.Contains(l => l.Id == expectedId1)
  .And.Contains(l => l.Id == expectedId2)
  .And.DoesNotContain(l => l.Id == nonExpectedId);

This is not possible any more, as the first Contains returns the wrapped item that was found, and the AndContinuation<T> does not have a Contains method (since it's one of the items of the list)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions