Skip to content
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

Repeating pattern values for BitAutoData attribute #5167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mzieniukbw
Copy link
Contributor

@mzieniukbw mzieniukbw commented Dec 19, 2024

๐ŸŽŸ๏ธ Tracking

๐Ÿ“” Objective

BitAutoData attribute, where instead of providing all possibilities of values for given argument one by one, hence duplicating the attribute over and over, you provide the possible values to test in array, resulting in one attribute, called RepeatingPatternBitAutoData.

Before:

    [Theory]
    [BitAutoData(false, false, false)]
    [BitAutoData(true, false, false)]
    [BitAutoData(false, true, false)]
    [BitAutoData(true, true, false)]
    [BitAutoData(false, false, true)]
    [BitAutoData(true, false, true)]
    [BitAutoData(false, true, true)]
    public void MyTest(bool arg1, bool arg2, bool arg3)

After:

    [Theory]
    [RepeatingPatternBitAutoData([false, true], [false, true], [false, true])
    public void MyTest(bool arg1, bool arg2, bool arg3)

Other examples: testing whether string is null, empty or contains whitespace[RepeatingPatternBitAutoData([null, "", " "])

๐Ÿ“ธ Screenshots

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests โœ…

Project coverage is 43.35%. Comparing base (4f50461) to head (9ab2bf5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5167   +/-   ##
=======================================
  Coverage   43.35%   43.35%           
=======================================
  Files        1456     1456           
  Lines       66468    66468           
  Branches     6078     6078           
=======================================
  Hits        28817    28817           
  Misses      36360    36360           
  Partials     1291     1291           

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

Copy link
Contributor

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 4ce75c72-4cc2-4d9f-ad9c-bb2b5c35828b

No New Or Fixed Issues Found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant