Exemple #1
0
        /// <summary>
        /// Returns a list of the consumers enumerated in this object.
        /// </summary>
        /// <returns></returns>
        public string ListOfConsumers()
        {
            IList <string> consumerLists = new List <string>();

            if (InputParameters.Any())
            {
                consumerLists.Add($"input parameters = {string.Join(",", InputParameters)}");
            }

            if (EquivalenceClasses.Any())
            {
                consumerLists.Add($"equivalence classes = {string.Join(",", EquivalenceClasses)}");
            }

            if (ExpectedResults.Any())
            {
                consumerLists.Add($"expected results = {string.Join(",", ExpectedResults)}");
            }

            if (CoverageGroups.Any())
            {
                consumerLists.Add($"coverage groups = {string.Join(",", CoverageGroups)}");
            }

            if (!consumerLists.Any())
            {
                return(null);
            }

            return(string.Join(";", consumerLists));
        }
Exemple #2
0
        /// <summary>
        /// Validates the test specification and returns true if successful; otherwise false
        /// and returns an informative error message.
        /// </summary>
        public bool Validate(IList <string> errors)
        {
            bool validated = true;

            if ((EquivalenceClasses == null) || !EquivalenceClasses.Any())
            {
                errors.Add($"input parameter {Name} has no equivalence classes");
                validated = false;
            }
            else
            {
                foreach (EquivalenceClass equivalenceClass in EquivalenceClasses.Values)
                {
                    validated = equivalenceClass.Validate(errors) && validated;
                }
            }

            return(validated);
        }