testGenerateTemplate method

  1. @override
dynamic testGenerateTemplate()
override

Implementation

@override
testGenerateTemplate() {
  group('Generate template:', () {
    if (simpleMessage != null) {
      test('Simple Message', () {
        expectFormatTemplateGeneration(
          simpleMessage,
          format,
          messages: [messages['simpleMessage']],
        );
      });
    }

    if (messageWithMetadata != null) {
      test('Simple Message with Metadata', () {
        expectFormatTemplateGeneration(
          messageWithMetadata,
          format,
          messages: [messages['messageWithMetadata']],
        );
      });
    }

    if (pluralMessage != null) {
      test('Plural Message', () {
        expectFormatTemplateGeneration(
          pluralMessage,
          format,
          messages: [messages['pluralExample']],
        );
      });
    }

    if (messageWithMetadata != null) {
      test('Message with Variable', () {
        expectFormatTemplateGeneration(
          variableMessage,
          format,
          messages: [messages['messageWithVariable']],
        );
      });
    }

    if (allMessages != null) {
      test('Multiple messages - full file', () {
        expectFormatTemplateGeneration(
          allMessages,
          format,
          messages: messages.values.toList(),
        );
      });
    }
  });
}