Skip to content

Have tests also validate config.txt #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ikbendewilliam opened this issue Dec 23, 2022 · 1 comment · Fixed by #143
Closed

Have tests also validate config.txt #126

ikbendewilliam opened this issue Dec 23, 2022 · 1 comment · Fixed by #143
Assignees

Comments

@ikbendewilliam
Copy link
Contributor

The config.txt is not read in a test. This seems like an oversight?

Example Unknown enum value:
Config:

Person:
  path: user/person/
  type: object
  properties:
    firstName:
      required: false
      include_if_null: false
      type: string
Gender:
  path: user/person/
  type: enum
  properties:
    MALE:
    FEMALE:
    X:

Test:

    test('Normal ObjectModelWriter with do not includeIfNull', () {
      final model = ObjectModel(
        name: 'Person',
        path: 'path_to_my_model',
        baseDirectory: 'base_dir',
        generateForGenerics: false,
        staticCreate: false,
        fields: [
          Field(
            name: 'gender',
            type: ObjectType('Gender'),
            isRequired: true,
            ignore: false,
            includeIfNull: true,
            nonFinal: false,
            unknownEnumValue: 'X',
            ignoreEquality: false,
          ),
        ],
        converters: [],
      );
      WriterTestHelper.testObjectModelWriter(model, [], 'unknown-enum-value');
    });

Either we use final model = ObjectModel( and remove the config.txt or we use the config.txt.

@ikbendewilliam
Copy link
Contributor Author

@jorre127 check de changes in #127 daar zat dat wel in 😁

@jorre127 jorre127 moved this from Todo to In Progress in icapps Flutter OSS Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
jorre127 added a commit that referenced this issue Aug 30, 2023
@jorre127 jorre127 moved this from In Progress to In Review in icapps Flutter OSS Aug 30, 2023
vanlooverenkoen added a commit that referenced this issue Sep 7, 2023
@github-project-automation github-project-automation bot moved this from In Review to Done in icapps Flutter OSS Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants