Shouldly
  • Overview
  • Contributing
  • Documentation
    • Getting Started
    • Configuration
    • Equality
      • ShouldBe
      • NotBe
      • Null
      • Bool
      • Flags
      • AssignableTo
      • OfType
      • OneOf
      • Greater/Less Than
      • InRange
      • MatchApproved
      • Enumerable
      • SameAs
      • String
      • ExampleClasses
    • String
      • ShouldBe
      • Match
      • Contain
      • Null and Empty
      • StartWith
      • EndWith
    • Enumerable
      • ShouldBe
      • All
      • Empty
      • OneOf
      • Contain
      • Unique
      • SubsetOf
      • Have
    • Dictionary
      • ContainKey
      • ContainKeyAndValue
    • Exceptions
      • Throw
      • NotThrow
    • SatisfyAllConditions
    • CompleteIn
    • DynamicShould
    • Upgrade 3 to 4
Powered by GitBook
On this page
Edit on GitHub
  1. Documentation
  2. Enumerable

All

PreviousEnumerableNextEmpty

Last updated 3 months ago

var mrBurns = new Person { Name = "Mr.Burns", Salary = 3000000 };
var kentBrockman = new Person { Name = "Homer", Salary = 3000000 };
var homer = new Person { Name = "Homer", Salary = 30000 };
var millionaires = new List<Person> { mrBurns, kentBrockman, homer };
millionaires.ShouldAllBe(m => m.Salary > 1000000);

|

Exception

millionaires
    should satisfy the condition
(m.Salary > 1000000)
    but
[Homer]
    do not
snippet source
anchor