anchor.diff:    return context.resolveCompilationUnit(source, libElement);
   }
   
  -const _classNoFieldsContent = r'''
  +CompilationUnit _compUnit;
  +
  +const _testSource = r'''
   import 'package:source_gen/json_serial/json_annotation.dart';
   
   @JsonSerializable()
  
positive.code: 
  const _generator = const JsonGenerator();
  
  Element _getClassForCodeString(String source, String name) =>
      _getElementsForCodeString(source).singleWhere((e) => e.name == name);
  
  Iterable<Element> _getElementsForCodeString(String source) {
    var cu =
        _getCompilationUnitForString(getPackagePath(), _classNoFieldsContent);
  
    return getElementsFromCompilationUnit(cu);
  }
  
  CompilationUnit _getCompilationUnitForString(
      String projectPath, String content) {
    Source source = new StringSource(content, 'test content');
  
    var context = getAnalysisContextForProjectPath(projectPath);
  
  
negative.code: void main() {
    group('non-classes', () {
      test('const field', () {
        var element = _getClassForCodeString('theAnswer');
  
        expect(() => _generator.generate(element), throws);
        // TODO: validate the properties on the thrown error
      });
  
      test('method', () {
        var element = _getClassForCodeString('annotatedMethod');
  
        expect(() => _generator.generate(element), throws);
        // TODO: validate the properties on the thrown error
  