private void AssertValidationResult <T>(Expression <Func <CreateCohortRequest, T> > property, T value, bool expectedValid)
        {
            // Arrange
            var validator = new CreateCohortRequestValidator(Mock.Of <IAuthorizationService>());

            // Act
            if (expectedValid)
            {
                validator.ShouldNotHaveValidationErrorFor(property, value);
            }
            else
            {
                validator.ShouldHaveValidationErrorFor(property, value);
            }
        }
        private void AssertValidationResult <T>(Expression <Func <CreateCohortRequest, T> > property, Func <string, bool> feature, T value, bool expectedValid)
        {
            // Arrange
            var authorizationService = new Mock <IAuthorizationService>();

            authorizationService.Setup(a => a.IsAuthorized(It.IsAny <string[]>()))
            .Returns <string[]>(o => feature(o.SingleOrDefault()));

            var validator = new CreateCohortRequestValidator(authorizationService.Object);

            // Act
            if (expectedValid)
            {
                validator.ShouldNotHaveValidationErrorFor(property, value);
            }
            else
            {
                validator.ShouldHaveValidationErrorFor(property, value);
            }
        }