Ejemplo n.º 1
0
        /// <summary>
        /// Creates a coverage group's new parameter with the given name and returns true if successful.
        /// </summary>
        public bool NewCoverageGroupInputParameter(string coverageGroupName, string newInputParameterName)
        {
            CoverageGroup coverageGroup = GetCoverageGroup(coverageGroupName);

            if (coverageGroup == null)
            {
                return(false);
            }

            if (coverageGroup.Parameters == null)
            {
                coverageGroup.Parameters = new List <string>();
            }

            coverageGroup.Parameters.Add(newInputParameterName);

            if (workingTestSpecification.SpecificationDependencies == null)
            {
                workingTestSpecification.UpdateDependencies();
            }
            else
            {
                workingTestSpecification.SpecificationDependencies.NewCoverageGroupReferences(
                    coverageGroupName, coverageGroup.Parameters);
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deletes the coverage group from the specification and returns true if successful.
        /// </summary>
        public bool DeleteCoverageGroup(string coverageGroupName)
        {
            CoverageGroup coverageGroup = GetCoverageGroup(coverageGroupName);

            if (coverageGroup == null)
            {
                return(false);
            }

            workingTestSpecification.CoverageGroups.Remove(coverageGroup);
            workingTestSpecification.SpecificationDependencies.DeleteCoverageGroupReferences(
                coverageGroupName);
            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new coverage group with the given name and returns true if successful.
        /// </summary>
        public bool NewCoverageGroup(string coverageGroupName)
        {
            if (workingTestSpecification == null)
            {
                return(false);
            }

            if (workingTestSpecification.CoverageGroups == null)
            {
                workingTestSpecification.CoverageGroups = new List <CoverageGroup>();
            }

            CoverageGroup coverageGroup = new CoverageGroup();

            coverageGroup.Name = coverageGroupName;
            workingTestSpecification.CoverageGroups.Add(coverageGroup);
            return(true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Deletes an input parameter in the coverage group from the specification and returns true if successful.
        /// If the parameter is the only one in the group, it deletes the group altogether.
        /// </summary>
        public bool DeleteCoverageGroupInputParameter(string coverageGroupName, string inputParameterName)
        {
            CoverageGroup coverageGroup = GetCoverageGroup(coverageGroupName);

            if (coverageGroup == null)
            {
                return(false);
            }

            if ((coverageGroup.Parameters.Count == 1) && coverageGroup.Parameters.Contains(inputParameterName))
            {
                return(DeleteCoverageGroup(coverageGroupName));
            }

            coverageGroup.Parameters.Remove(inputParameterName);
            workingTestSpecification.SpecificationDependencies.NewCoverageGroupReferences(
                coverageGroupName, coverageGroup.Parameters);
            return(true);
        }