This code is base on Eric Evans and Martin Fowler's article introducing the Specification pattern
Simple example in the tests can be found here UserPreviouslyActiveIsPartOfTheRecentlyInactiveCohort.cs
ISpecification<UserContext>inactiveCohort=newUserIsInactiveForOverTwoWeeks().And(newUserHasViewedSomeThing()).And(newUserHasUploadedSomeThing()).And(newUserHasNotReceivedAReportThisMonth());varuserContext=newUserContext{LastActiveDate=DateTime.UtcNow.AddDays(-15),LastReportSent=DateTime.UtcNow.AddMonths(-1),TotalUploads=10,TotalViews=50};booluserInCohort=inactiveCohort.IsSatisfiedBy(userContext)