Пример #1
0
        public static void MSpec(this ICakeContext context, GlobPattern pattern, MSpecSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            var assemblies = context.Globber.GetFiles(pattern).ToArray();

            if (assemblies.Length == 0)
            {
                context.Log.Verbose("The provided pattern did not match any files.");
                return;
            }

            MSpec(context, assemblies, settings);
        }
Пример #2
0
        public static void MSpec(this ICakeContext context, IEnumerable <string> assemblies, MSpecSettings settings)
        {
            if (assemblies == null)
            {
                throw new ArgumentNullException(nameof(assemblies));
            }
            var paths = assemblies.Select(p => new FilePath(p));

            MSpec(context, paths, settings);
        }
Пример #3
0
        public static void MSpec(this ICakeContext context, IEnumerable <FilePath> assemblies, MSpecSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(assemblies));
            }
            if (assemblies == null)
            {
                throw new ArgumentNullException(nameof(assemblies));
            }

            var runner = new MSpecRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);

            runner.Run(assemblies, settings);
        }
 internal static FilePath GetReportFileName(IReadOnlyList <FilePath> assemblyPaths, MSpecSettings settings)
 {
     if (string.IsNullOrEmpty(settings.ReportName))
     {
         return(assemblyPaths.Count == 1
             ? assemblyPaths[0].GetFilename()
             : new FilePath("TestResults"));
     }
     else
     {
         return(settings.ReportName);
     }
 }