예제 #1
0
        public void Start(
            IEnumerable <string> exampleFullNames)
        {
            var selectedNames = new HashSet <string>(exampleFullNames);

            var selector = new ContextSelector();

            string noTags = String.Empty;

            selector.Select(testAssemblyPath, noTags);

            var contexts = selector.Contexts;

            // original idea taken from osoftware/NSpecTestAdapter:
            // see https://github.com/osoftware/NSpecTestAdapter/blob/master/NSpec.TestAdapter/Executor.cs

            var allExamples = contexts.SelectMany(ctx => ctx.AllExamples());

            var selectedExamples = allExamples.Where(exm => selectedNames.Contains(exm.FullName()));

            var selectedContexts = selectedExamples.Select(exm => exm.Context).Distinct();

            foreach (var context in selectedContexts)
            {
                RunContext(context);
            }
        }
예제 #2
0
        public IEnumerable <DiscoveredExample> Start()
        {
            var selector = new ContextSelector();

            string noTags = String.Empty;

            selector.Select(testAssemblyPath, noTags);

            var contexts = selector.Contexts;

            var examples = contexts.Examples();

            var discoveredExamples =
                from exm in examples
                select MapToDiscovered(exm, testAssemblyPath);

            return(discoveredExamples);
        }