Exemple #1
0
        private static SpecificationDetailedCheckResult <IPublishedPCConfigurationCheckDetails> CreateResult(
            PublishedPCConfigurationCheckDetails details)
        {
            var isSatisfied = details.AllRequirementsSatisfied();

            return(new SpecificationDetailedCheckResult <IPublishedPCConfigurationCheckDetails>(isSatisfied, details));
        }
Exemple #2
0
        private void CheckComponentTypesSpecification(PCConfiguration entity, PublishedPCConfigurationCheckDetails details)
        {
            var typesSetDetails = _componentTypesSetSpecification.IsSatisfiedBy(entity);

            if (typesSetDetails.IsSatisfied)
            {
                return;
            }
            details.RequiredButNotAddedTypes      = typesSetDetails.FailureDetails.RequiredButNotAddedTypes;
            details.TypesViolatedUniqueConstraint = typesSetDetails.FailureDetails.TypesViolatedUniqueConstraint;
        }
Exemple #3
0
        private void CheckComponentsPlugSpecification(PCConfiguration entity, PublishedPCConfigurationCheckDetails details)
        {
            var componentsPlugDetails = _componentsCanBePluggedSpecification.IsSatisfiedBy(entity);

            if (componentsPlugDetails.IsSatisfied)
            {
                return;
            }
            details.ComponentsCycleFailure = !componentsPlugDetails.FailureDetails.CanPlugWithoutCycles;
            details.NotFoundInterfaces     = componentsPlugDetails.FailureDetails.NotFoundInterfaces;
        }
Exemple #4
0
        private PublishedPCConfigurationCheckDetails BuildCheckDetails(PCConfiguration entity)
        {
            var details = new PublishedPCConfigurationCheckDetails();

            if (!_nameNotEmptySpecification.IsSatisfiedBy(entity))
            {
                details.NameNotEmptyFailure = true;
            }
            if (!_maxLengthSpecification.IsSatisfiedBy(entity))
            {
                details.NameMaxLengthFailure = true;
            }

            CheckComponentTypesSpecification(entity, details);
            CheckComponentsPlugSpecification(entity, details);

            return(details);
        }