コード例 #1
0
        public static ParameterSpecification Combine(this ParameterSpecification left, ParameterSpecification right)
        {
            if (left == Any)
                return right;

            if (right == Any)
                return left;

            if (left == null || right == null)
                return left ?? right;

            return x =>
            {
                var leftOutcome = left(x);
                return leftOutcome.WasSuccessful
                    ? leftOutcome & right(x)
                    : leftOutcome;
            };
        }
コード例 #2
0
        public void Customize(IFixture fixture)
        {
            var spec = new ParameterSpecification(paramType, paramName);

            fixture.Customizations.Add(new FilteringSpecimenBuilder(new CapabilitySpecSpecimenBuilder(), spec));
        }
コード例 #3
0
        public string GetBackground()
        {
            var backgroundColor = (_unitOfWork.Parameters.Find(ParameterSpecification.OfType <BackgroundColor>())).FirstOrDefault();

            return(backgroundColor?.Value ?? string.Empty);
        }