Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
FluentAssertions: Assert that a collection contains any item that contains a string (case insensitive)

I have a collection of strings

var greetings = new[] { "Hello boy", "Hello girl", "Hello all"};

I would like to create an assertion using FluentAssertions that verifies that the collection contains at least one item that contains a given string.

Example. For the previous collection,

  • testing with "boy", should pass.
  • testing with "Girl" should pass.
  • testing with "hello" should pass.
  • testing with "ouch" should NOT pass (because there is not item in the collection that contains this string).

I've tried with:

greetings.Should().ContainMatch("*" + str + "*");

But it doesn't work becuase it's case sensitive.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!