コード例 #1
0
        /// <summary>
        /// Returns the mutation score for this folder / file
        /// </summary>
        /// <returns>decimal between 0 and 1 or null when no score could be calculated</returns>
        public double GetMutationScore()
        {
            double totalCount  = TotalMutants.Count();
            double killedCount = DetectedMutants.Count();

            return(killedCount / totalCount);
        }
コード例 #2
0
        /// <summary>
        /// Returns the mutation score for this folder / file
        /// </summary>
        /// <returns>decimal between 0 and 1 or null when no score could be calculated</returns>
        public decimal?GetMutationScore()
        {
            var totalCount  = TotalMutants.Count();
            var killedCount = DetectedMutants.Count();

            if (totalCount > 0)
            {
                return(killedCount / (decimal)totalCount);
            }
            else
            {
                return(null);
            }
        }