Skip to content
New issue

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

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

Already on GitHub? # to your account

Add Random User Agent Generator #28

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Conversation

gabeaventh
Copy link
Contributor

  • Add userAgent method to internet.dart

  • Add UserAgent and UserAgents model to parse json data

  • Add userAgentDatas

  • Add Test for userAgent under test/specs/internet.dart

  • Add example for userAgent

Connection with issue(s)

Resolve issue #26

Testing and Review Notes

Generates an User Agent from Predefined Dictionary with the given osName if provided.
if not provided osName is an empty String or ''
osName will automatically converted into lowerCase

Examples:

faker.internet.userAgent();
faker.internet.userAgent(osName:'iOS');

Results:

  • without osName :
    Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-SM-G900A Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Safari/537.36

  • with osName :
    Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8F190

To Do

  • double check the original issue to confirm it is fully satisfied
  • add testing notes and screenshots in PR description to help guide reviewers

- Add userAgent method to internet.dart

- Add UserAgent and UserAgents model to parse json data

- Add userAgentDatas

- Add Test for userAgent under test/specs/internet.dart

- Add example for userAgent
Copy link
Owner

@drager drager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks a lot!

@drager drager merged commit c3ef114 into drager:master Oct 27, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants