anchor.diff:    noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
   }
   
  -foo() {
  -  testCase(
  -      thatWhen: 'no projects provided',
  -      asProvidedBy: () => [],
  -      expectTheseInvocations: () => []);
  -}
  +//foo() {
  +//  testCase(
  +//      thatWhen: 'no projects provided',
  +//      asProvidedBy: () => [],
  +//      expectTheseInvocations: () => []);
  +//}
   
   testCase({String thatWhen, Iterable<Project> asProvidedBy(),
  -    List<TestProcessInvocation> expectTheseInvocations()}) {
  +    List<TestProcessInvocation> expectTheseInvocations(
  +        Iterable<Project> projects)}) {
     TestProcessor processor;
  -
  -  scheduleForProjects(Iterable<Project> projects) {
  +  Iterable<Project> theProjects;
  +
  +  scheduleForProjects(Iterable<Project> projects()) {
       return schedule(() async {
  +      theProjects = projects();
         processor = new TestProcessor();
  -      final DependencyGraph graph = await getDependencyGraph(projects.toSet());
  +      final DependencyGraph graph =
  +          await getDependencyGraph(theProjects.toSet());
         return graph.depthFirst(processor);
       });
     }
   
  -  setUpForProjects(Iterable<Project> projects) {
  +  setUpForProjects(Iterable<Project> projects()) {
       setUp(() => scheduleForProjects(projects));
     }
   
  -  group(thatWhen, () {
  -    setUpForProjects(asProvidedBy());
  -    TestProcessor.createTests(() => processor, expectTheseInvocations());
  -  });
  -}
  -
  -awhen(String name, {Iterable<Project> withProjects()}) {}
  -
  -Project aproject(String name,
  -    {Iterable<PathReference> pathDependencies: const []}) {}
  +  group('when $thatWhen', () {
  +    setUpForProjects(asProvidedBy);
  +    TestProcessor.createTests(
  +        () => processor, () => expectTheseInvocations(theProjects));
  +  });
  +}
  +
  +Project aProject(String name,
  +    {Iterable<PathReference> pathDependencies: const []}) {
  +  final dependencies = {};
  +  pathDependencies.forEach((pd) {
  +    // WARNING: only makes sense if path == name
  +    dependencies[pd.path] = pd;
  +  });
  +
  +  return new MockProject(
  +      name, new PubSpec(name: name, dependencies: dependencies));
  +}
   
   class TestPrecondition {
     String description;
  
positive.code:   }
  
    static createTests(
        TestProcessor processor(), List<TestProcessInvocation> expected) {
      test('has expected number of invocations', () {
        schedule(
            () => expect(processor().invocations, hasLength(expected.length)));
      });
  
      group('each invocation matches expectation', () {
        for (int i = 0; i < expected.length; i++) {
          TestProcessInvocation.createTests(
              () => processor().invocations[i], expected[i]);
        }
      });
    }
  
negative.code:     testCase(
          thatWhen: 'no projects provided',
          asProvidedBy: () => [],
          expectTheseInvocations: (_) => []);
  
      testCase(
          thatWhen: 'a single project has no dependencies',
          asProvidedBy: () => [aProject('project1')],
          expectTheseInvocations: (Iterable<Project> projects) =>
              [new TestProcessInvocation(projects.first, const [])]);
  
  //    group('for one project with no dependencies', () {
  //      MockProject project1;
  //
  //      setUp(() {
  //        project1 = new MockProject('project1', new PubSpec());
  //        scheduleForProjects([project1]);
  //      });
  //
  //      test('calls processor once', () {
  //        schedule(() => expect(processor.invocations, hasLength(1)));
  //      });
  //
  //      test('calls processor once with expected project', () {
  //        schedule(() =>
  //            expect(processor.invocations.first.project, equals(project1)));
  //      });
  //
  //      test('calls processor once with no dependencies', () {
  //        schedule(
  //            () => expect(processor.invocations.first.dependencies, isEmpty));
  //      });
  //    });
  
    });
  }
  
  