Beispiel #1
0
        private TestScenariousValidationResult ValidateRunAction(string[] parameters)
        {
            string folderWithPositives = parameters[1];

            if (!Directory.Exists(folderWithPositives))
            {
                return
                    (TestScenariousValidationResult.InvalidResult(
                         $"Path to folder with positives '{folderWithPositives}' is not valid"));
            }

            string folderWithNegatives = parameters[2];

            if (!Directory.Exists(folderWithNegatives))
            {
                return
                    (TestScenariousValidationResult.InvalidResult(
                         $"Path to folder with negatives '{folderWithNegatives}' is not valid"));
            }

            try
            {
                utils.ToStride(parameters[3], parameters[4], parameters[5]);
                _ = int.Parse(parameters[6]);
                utils.ParseInts(parameters[7], testRunnerConfig.StartAtsSeparator);
            }
            catch (Exception e)
            {
                return(TestScenariousValidationResult.InvalidResult(e.Message));
            }

            var positives = utils.ListFiles(folderWithPositives, testRunnerConfig.AudioFileFilters);

            if (!positives.Any())
            {
                return
                    (TestScenariousValidationResult.InvalidResult(
                         string.Format("Folder with positives is empty: {0}", folderWithPositives)));
            }

            return(TestScenariousValidationResult.ValidResult());
        }
Beispiel #2
0
 private List <int> ToStartAts(string startAtSeconds)
 {
     return(utils.ParseInts(startAtSeconds, testRunnerConfig.StartAtsSeparator));
 }