anchor.diff:        }
     }
   }''';
  -      final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
  -        ..createSync(recursive: true);
  -      l10nDirectory.childFile(defaultTemplateArbFileName)
  -        .writeAsStringSync(singleDateMessageArbFileString);
  -
  -      final LocalizationsGenerator generator = LocalizationsGenerator(fs);
  -      try {
  -        generator.initialize(
  -          l10nDirectoryPath: defaultArbPathString,
  -          templateArbFileName: defaultTemplateArbFileName,
  -          outputFileString: defaultOutputFileString,
  -          classNameString: defaultClassNameString,
  -        );
  -        generator.parseArbFiles();
  -        generator.generateClassMethods();
  -      } on L10nException catch (e) {
  -        expect(e.message, contains('asdf'));
  -        expect(e.message, contains('springStartDate'));
  -        expect(e.message, contains('does not have a corresponding DateFormat'));
  -        return;
  -      }
  -
  -      fail('Improper date formatting should throw an exception');
  -    });
  -
  -    test('throws an exception when no format attribute is passed in', () {
  -      const String singleDateMessageArbFileString = '''{
  +        final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
  +          ..createSync(recursive: true);
  +        l10nDirectory.childFile(defaultTemplateArbFileName)
  +          .writeAsStringSync(singleDateMessageArbFileString);
  +
  +        final LocalizationsGenerator generator = LocalizationsGenerator(fs);
  +        try {
  +          generator.initialize(
  +            l10nDirectoryPath: defaultArbPathString,
  +            templateArbFileName: defaultTemplateArbFileName,
  +            outputFileString: defaultOutputFileString,
  +            classNameString: defaultClassNameString,
  +          );
  +          generator.parseArbFiles();
  +          generator.generateClassMethods();
  +        } on L10nException catch (e) {
  +          expect(e.message, contains('asdf'));
  +          expect(e.message, contains('springStartDate'));
  +          expect(e.message, contains('does not have a corresponding DateFormat'));
  +          return;
  +        }
  +
  +        fail('Improper date formatting should throw an exception');
  +      });
  +
  +      test('throws an exception when no format attribute is passed in', () {
  +        const String singleDateMessageArbFileString = '''{
     "springBegins": "Spring begins on {springStartDate}",
     "@springBegins": {
         "description": "The first day of spring",
  
positive.code: ''');
      });
  
      test('correctly generates simple message with dates', () {
        const String singleDateMessageArbFileString = '''{
    "springBegins": "Spring begins on {springStartDate}",
    "@springBegins": {
        "description": "The first day of spring",
  
negative.code:     );
    }
  '''
          );
        });
  
      test('should throw attempting to generate a plural message without placeholders', () {
        const String pluralMessageWithoutPlaceholdersAttribute = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello World}=2{Hello two worlds}few{Hello {count} worlds}many{Hello all {count} worlds}other{Hello other {count} worlds}}",
    "@helloWorlds": {
      "description": "Improperly formatted since it has no placeholder attribute."
    }
  }''';
  
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithoutPlaceholdersAttribute);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on L10nException catch (e) {
            expect(e.message, contains('Check to see if the plural message is in the proper ICU syntax format'));
            return;
          }
          fail('Generating class methods without placeholders should not succeed');
        });
  
        test('should throw attempting to generate a plural message with an empty placeholders map', () {
          const String pluralMessageWithEmptyPlaceholdersMap = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello World}=2{Hello two worlds}few{Hello {count} worlds}many{Hello all {count} worlds}other{Hello other {count} worlds}}",
    "@helloWorlds": {
      "description": "Improperly formatted since it has no placeholder attribute.",
      "placeholders": {}
    }
  }''';
  
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithEmptyPlaceholdersMap);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on L10nException catch (e) {
            expect(e.message, contains('Check to see if the plural message is in the proper ICU syntax format'));
            return;
          }
          fail('Generating class methods without placeholders should not succeed');
        });
  
        test('should throw attempting to generate a plural message with no resource attributes', () {
          const String pluralMessageWithoutResourceAttributes = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello World}=2{Hello two worlds}few{Hello {count} worlds}many{Hello all {count} worlds}other{Hello other {count} worlds}}"
  }''';
  
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithoutResourceAttributes);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on L10nException catch (e) {
            expect(e.message, contains('Resource attribute'));
            expect(e.message, contains('does not exist'));
            return;
          }
          fail('Generating plural class method without resource attributes should not succeed');
        });
  
        test('should throw attempting to generate a plural message with incorrect format for placeholders', () {
          const String pluralMessageWithIncorrectPlaceholderFormat = '''{
    "helloWorlds": "{count,plural, =0{Hello}=1{Hello World}=2{Hello two worlds}few{Hello {count} worlds}many{Hello all {count} worlds}other{Hello other {count} worlds}}",
    "@helloWorlds": {
      "placeholders": "Incorrectly a string, should be a map."
    }
  }''';
  
          final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
            ..createSync(recursive: true);
          l10nDirectory.childFile(defaultTemplateArbFileName)
            .writeAsStringSync(pluralMessageWithIncorrectPlaceholderFormat);
  
          final LocalizationsGenerator generator = LocalizationsGenerator(fs);
          try {
            generator.initialize(
              l10nDirectoryPath: defaultArbPathString,
              templateArbFileName: defaultTemplateArbFileName,
              outputFileString: defaultOutputFileString,
              classNameString: defaultClassNameString,
            );
            generator.parseArbFiles();
            generator.generateClassMethods();
          } on L10nException catch (e) {
            expect(e.message, contains('is not properly formatted'));
            expect(e.message, contains('Ensure that it is a map with keys that are strings'));
            return;
          }
          fail('Generating class methods with incorrect placeholder format should not succeed');
        });
      });
  
      test('should throw when failing to parse the arb file', () {
        const String arbFileWithTrailingComma = '''{
    "title": "Stocks",
    "@title": {
      "description": "Title for the Stocks application"
    },
  }''';
        final Directory l10nDirectory = fs.currentDirectory.childDirectory('lib').childDirectory('l10n')
          ..createSync(recursive: true);
        l10nDirectory.childFile(defaultTemplateArbFileName)
          .writeAsStringSync(arbFileWithTrailingComma);
  
        final LocalizationsGenerator generator = LocalizationsGenerator(fs);
        try {
  