The recommended way is to use OnlyContain
:
items.Should().OnlyContain(x => x.IsActive, "because I said so!");
These will also work:
items.All(x => x.IsActive).Should().BeTrue("because I said so!");
items.Select(x => x.IsActive.Should().BeTrue("because I said so!"))
.All(x => true);
Note that the last line (.All(x => true)
) forces the previous Select
to execute for each item.