WithDefaultState() public method

public WithDefaultState ( ConditionState state ) : ConditionsValidator
state ConditionState
return ConditionsValidator
Example #1
0
        public ConditionState Validate()
        {
            ConditionState thisState = Expression();

            if (RelatedConditions.Any())
            {
                _relatedConditionsValidator.WithDefaultState(thisState);
                return(_relatedConditionsValidator.Validate());
            }

            return(thisState);
        }
Example #2
0
        public ConditionState Validate()
        {
            var thisState = Expression();

            if (IsInverted)
            {
                thisState = thisState == ConditionState.Fulfilled
                    ? ConditionState.NotFulfilled
                    : ConditionState.Fulfilled;
            }

            if (RelatedConditions.Any())
            {
                _relatedConditionsValidator.WithDefaultState(thisState);
                return(_relatedConditionsValidator.Validate());
            }

            return(thisState);
        }