-
Notifications
You must be signed in to change notification settings - Fork 7
Prepare documentation #262
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughA comprehensive set of new documentation files was added, covering the attributes and features of the AutoFixture.XUnit2.AutoMock library. The documentation introduces and explains test data generation, customization, and filtering attributes, provides usage examples, and offers guidance on supported mocking libraries and advanced testing tips. Additionally, new GitHub Actions workflows were added for building and deploying documentation, and CI/CD pipeline triggers were refined. Changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docs/attributes/inline-auto-mock-data-attribute.md (1)
7-8: Mirror the updated wording from AutoMockData for consistencySame phrasing tweak as suggested in
auto-mock-data-attribute.md:-`IgnoreVirtualMembers` - disables generation of members marked as `virtual`; by default set to `false` +`IgnoreVirtualMembers` – disables population of members marked as `virtual` (default: `false`)
🧹 Nitpick comments (15)
docs/attributes/pick-negative-attribute.md (1)
5-5: Replace “being used on” with concise wording“when being used on” reads awkwardly; “when used on” is shorter and clearer.
docs/attributes/pick-from-range-attribute.md (1)
3-3: State whether the range is inclusive or exclusiveThe sentence claims “values from a specified range” but the example asserts
> 11 and < 19, implying exclusivity. Explicitly clarifying the contract avoids confusion for readers.docs/attributes/pick-from-values-attribute.md (1)
11-12:Assert.Equivalentrequires .NET 8; mention the requirement or use a more widely-available helperTeams still on earlier TFMs won’t compile this snippet. Either note the minimum framework or fall back to
Assert.Subsetor a loop for compatibility.docs/attributes/except-attribute.md (1)
3-3: Rephrase for clarity“Ensures that values from outside the specified list will be generated” double-negatives itself. Consider:
“Ensures that generated values exclude the specified list.”
docs/supported-mocking-libraries.md (1)
5-7: Fix minor URL inconsistencyRow 7 omits the trailing slash in the NuGet URL (
…/AutoFakeItEasy) while the other rows include it. Aligning the style prevents unnecessary redirects and keeps the table uniform.docs/index.md (1)
3-3: Hyphenate compound adjective & streamline the intro sentenceMinor editorial tweaks for clarity and style:
-AutoFixture.XUnit2.AutoMock is a free, open source tool which accelerates preparation of mocked structures for unit tests under [XUnit2](http://xunit.github.io/) by configuring [AutoFixture](https://github.com/AutoFixture/AutoFixture) data generation to use a mocking library of your choice. Gracefully handles recursive structures by omitting recursions. +AutoFixture.XUnit2.AutoMock is a free, open-source tool that accelerates the preparation of mocked objects for unit tests using [xUnit.net](https://xunit.net/) by configuring [AutoFixture](https://github.com/AutoFixture/AutoFixture) to work with the mocking library of your choice. It gracefully handles recursive structures by omitting recursions.docs/attributes/auto-mock-data-attribute.md (1)
7-8: Tighten wording of theIgnoreVirtualMembersbullet-`IgnoreVirtualMembers` - disables generation of members marked as `virtual`; by default set to `false` +`IgnoreVirtualMembers` – disables population of members marked as `virtual` (default: `false`)docs/attributes/index.md (1)
12-12: Escape generic type brackets for Markdown safetySome Markdown renderers treat
<T>as an HTML tag and drop it. Keeping the back-slash escape inside the link text avoids surprises:-[CustomizeWith\<T>](customize-with-t-attribute.md): Generic version of CustomizeWith for ease of use. +[CustomizeWith\\<T>](customize-with-t-attribute.md): Generic version of `CustomizeWith` for ease of use.docs/attributes/member-auto-mock-data-attribute.md (1)
13-13: Add comma after conjunctive adverb-**Caution:** The property is completely enumerated by .ToList() before any test is run. Hence it should return independent object sets. +**Caution:** The property is completely enumerated by `.ToList()` before any test is run. Hence, it should return independent object sets.docs/attributes/ignore-virtual-members-attribute.md (2)
5-5: Grammar – replace “allows to disable” with “allows disabling”.-This attribute allows to disable the generation of members marked as `virtual` on a decorated type whereas `IgnoreVirtualMembers` arguments of mocking attributes mentioned above disable such a generation for all types created by `IFixture`. +This attribute allows disabling the generation of members marked as `virtual` on the decorated type, whereas the `IgnoreVirtualMembers` argument on the mocking attributes mentioned above disables such generation for all types created by the `IFixture`.
7-8: Clarity – re-phrase the “Caution” sentence.The current wording is hard to parse.
-**Caution:** Order is important! Applying `IgnoreVirtualMembers` attribute to the subsequent parameter makes preceding parameters of the same type to have `virtual` properties populated and the particular parameter with the following ones of the same type to have `virtual` properties unpopulated. +**Caution:** Order is important. If you apply the `IgnoreVirtualMembers` attribute to a parameter, all *preceding* parameters of the same type still have their `virtual` properties populated, while the decorated parameter—and any *subsequent* parameters of that type—have those properties left unpopulated.docs/tips-and-tricks.md (2)
5-5: Preposition fix – “into a test method”.-You can inject the same instance of `IFixture` to a test method by adding the mentioned interface as an argument of the test method. +You can inject the same instance of `IFixture` into a test method by adding the interface as a parameter to the method.
34-34: Grammar & punctuation tweaks.-You can see that only `Substitute` property has been explicitly marked as `virtual`. In such a situation, *the compiler* will mark other properties as `virtual` and `sealed`. And finally [AutoFixture](https://github.com/AutoFixture/AutoFixture) will assign `null` value to those properties when option `IgnoreVirtualMembers` is set to `true`. +Only the `Substitute` property is explicitly marked as `virtual`. In this situation, *the compiler* marks the remaining properties as `virtual` **and** `sealed`. Consequently, [AutoFixture](https://github.com/AutoFixture/AutoFixture) assigns `null` to those properties when the `IgnoreVirtualMembers` option is set to `true`.docs/attributes/customize-with-attribute.md (1)
9-10: Clarity – streamline the “Caution” sentence.-**Caution:** Order is important! Applying `CustomizeWith` attribute to the subsequent parameter makes preceding parameters of the same type to be created without specified customization and the particular parameter with the specified customization. +**Caution:** Order is important. If you apply the `CustomizeWith` attribute to a parameter, all preceding parameters of the same type are created without the customization, while the decorated parameter (and any following parameters of that type) use it.docs/attributes/customize-with-t-attribute.md (1)
1-3: Minor: escape the generic marker only once.The heading renders
\<T>literally in Markdown viewers. Remove escape to render “<T>”.-# CustomizeWith\<T> Attribute +# CustomizeWith<T> Attribute
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
docs/attributes/auto-mock-data-attribute.md(1 hunks)docs/attributes/customize-with-attribute.md(1 hunks)docs/attributes/customize-with-t-attribute.md(1 hunks)docs/attributes/except-attribute.md(1 hunks)docs/attributes/ignore-virtual-members-attribute.md(1 hunks)docs/attributes/index.md(1 hunks)docs/attributes/inline-auto-mock-data-attribute.md(1 hunks)docs/attributes/member-auto-mock-data-attribute.md(1 hunks)docs/attributes/pick-from-range-attribute.md(1 hunks)docs/attributes/pick-from-values-attribute.md(1 hunks)docs/attributes/pick-negative-attribute.md(1 hunks)docs/index.md(1 hunks)docs/supported-mocking-libraries.md(1 hunks)docs/tips-and-tricks.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/supported-mocking-libraries.md
[style] ~7-~7: Using many exclamation marks might seem excessive (in this case: 6 exclamation marks for a text that’s 1426 characters long)
Context: .../github.com/FakeItEasy/FakeItEasy) | [
docs/index.md
[uncategorized] ~3-~3: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... AutoFixture.XUnit2.AutoMock is a free, open source tool which accelerates preparation of m...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
docs/attributes/member-auto-mock-data-attribute.md
[uncategorized] ~13-~13: A comma may be missing after the conjunctive/linking adverb ‘Hence’.
Context: ...ed by .ToList() before any test is run. Hence it should return independent object set...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
docs/attributes/ignore-virtual-members-attribute.md
[grammar] ~5-~5: Did you mean “disabling”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun.
Context: ...ce of that type. This attribute allows to disable the generation of members marked as `vi...
(ALLOW_TO)
[uncategorized] ~5-~5: Possible missing comma found.
Context: ...bers marked as virtual on a decorated type whereas IgnoreVirtualMembers argument...
(AI_HYDRA_LEO_MISSING_COMMA)
docs/tips-and-tricks.md
[uncategorized] ~34-~34: You might be missing the article “the” here.
Context: ...et; set; } } ``` You can see that only Substitute property has been explicitly...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~34-~34: Possible missing comma found.
Context: ...operties as virtual and sealed. And finally [AutoFixture](https://github.com/AutoFi...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~34-~34: You might be missing the article “the” here.
Context: ...n null value to those properties when option IgnoreVirtualMembers is set to true...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
🔇 Additional comments (2)
docs/attributes/pick-negative-attribute.md (1)
8-14: Check if[AutoMockData]should be used instead of[AutoData]Most examples in this repo leverage the Auto‐Mock integration attribute.
If that convention applies here, switching to[AutoMockData]will improve consistency and ensure mocks are injected.docs/attributes/pick-from-range-attribute.md (1)
9-11: Align the example assertion with the documented contractIf the attribute is meant to be inclusive (
11 ≤ x ≤ 19), update the assertion; if exclusive, say so in the text. Keeping code and prose in sync prevents copy-paste misuse.
|
|
||
| combined with auto-generated data specimens generated by [AutoFixture](https://github.com/AutoFixture/AutoFixture) with a mocking library. | ||
|
|
||
| The member must return something compatible with `Enumerable<object[]>` with the test data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix interface name typo
Enumerable<object[]> → IEnumerable<object[]>
-The member must return something compatible with `Enumerable<object[]>` with the test data.
+The member must return an `IEnumerable<object[]>` containing the test data.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| The member must return something compatible with `Enumerable<object[]>` with the test data. | |
| The member must return an `IEnumerable<object[]>` containing the test data. |
🤖 Prompt for AI Agents
In docs/attributes/member-auto-mock-data-attribute.md at line 11, correct the
interface name typo by changing `Enumerable<object[]>` to
`IEnumerable<object[]>` to use the proper interface name.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #262 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 39 39
Lines 424 424
Branches 55 55
=========================================
Hits 424 424
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
.github/workflows/cicd.yml (1)
1-1: Remove the unexpected UTF-8 BOMLine 1 contains a zero-width “BOM” character (
\uFEFF) beforename:.
Although most runners ignore it, certain tooling (e.g.yq, some linters) will choke on it.-name: '♻️ CI/CD' +name: '♻️ CI/CD'
♻️ Duplicate comments (1)
docs/attributes/member-auto-mock-data-attribute.md (1)
11-11: Fix interface name typo & add missing article
A duplicate of a prior review comment-The member must return type compatible with `Enumerable<object[]>` containing the test data. +The member must return a type compatible with `IEnumerable<object[]>` containing the test data.
🧹 Nitpick comments (9)
mkdocs.yml (1)
24-24: Strip trailing spaces & terminate file with a newlineYAML linters are currently flagging this line for:
- trailing spaces after
badges.md- missing newline at end-of-file
Both issues can break strict CI checks.
- - Badges: badges.md␠␠ + - Badges: badges.md +.github/workflows/cicd.yml (1)
7-18: Minor duplication – preferpaths-ignorefor clearer intentUsing positive patterns plus negations works, but the four new negated entries (
mkdocs.yml,docs.yml) are duplicated in bothpull_requestandpushblocks.
Considerpaths-ignoreto make the exclusion explicit and DRY:on: pull_request: paths-ignore: - mkdocs.yml - .github/workflows/docs.yml push: paths-ignore: - mkdocs.yml - .github/workflows/docs.ymlFunctionally equivalent and easier to maintain.
Also applies to: 24-35
docs/supported-mocking-libraries.md (1)
4-5: Table delimiter alignment is offMarkdown requires the separator row to match the number of columns.
Column 1 currently ends with:(right-aligned) while column 2 starts with:(left-aligned); that’s fine, but the dash count is far longer than needed and can mislead future editors.-| ---------------------------------------------------------:|:--------------------------- | +| ------------------------------: | :----------------------- |(Optional) add a trailing blank line to avoid EOF-newline warnings.
docs/index.md (1)
3-3: Hyphenate “open-source”Compound adjective before a noun should be hyphenated for clarity.
-AutoFixture.XUnit2.AutoMock is a free, open source tool +AutoFixture.XUnit2.AutoMock is a free, open-source tooldocs/attributes/member-auto-mock-data-attribute.md (1)
13-13: Insert comma after conjunctive adverb-...before any test is run. Hence it should return independent object sets. +...before any test is run. Hence, it should return independent object sets.docs/tips-and-tricks.md (2)
5-5: Clarify the phrasing to improve readabilityThe expression “adding the mentioned interface as an argument” is hard to parse. A more direct wording improves flow.
-You can inject the same instance of `IFixture` into a test method by adding the mentioned interface as an argument of the test method. +You can inject the same `IFixture` instance into your test simply by declaring an `IFixture` parameter in the method signature.
34-34: Minor grammar fixes (“the” + comma)-Only `Substitute` property is explicitly marked as `virtual`. In such a situation, *the compiler* marks the remaining properties as `virtual` and `sealed`. Consequently [AutoFixture](https://github.com/AutoFixture/AutoFixture) assigns `null` value to those properties when the `IgnoreVirtualMembers` option is set to `true`. +Only the `Substitute` property is explicitly marked as `virtual`. In this situation, *the compiler* marks the remaining properties as `virtual` and `sealed`, and, consequently, [AutoFixture](https://github.com/AutoFixture/AutoFixture) assigns a `null` value to those properties when `IgnoreVirtualMembers` is set to `true`..github/workflows/docs.yml (2)
61-66: Trim trailing whitespaceLine 66 ends with superfluous spaces, flagged by YAMLlint. Remove them to keep the file lint-clean.
- path: ./site␠␠ + path: ./site
77-77: Add a terminating newlineUnix convention and several linters require a final newline; add one to avoid lint noise.
- uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v4⏎
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
.github/workflows/cicd.yml(3 hunks).github/workflows/docs.yml(1 hunks)README.md(1 hunks)docs/attributes/auto-mock-data-attribute.md(1 hunks)docs/attributes/ignore-virtual-members-attribute.md(1 hunks)docs/attributes/inline-auto-mock-data-attribute.md(1 hunks)docs/attributes/member-auto-mock-data-attribute.md(1 hunks)docs/attributes/pick-negative-attribute.md(1 hunks)docs/index.md(1 hunks)docs/supported-mocking-libraries.md(1 hunks)docs/tips-and-tricks.md(1 hunks)mkdocs.yml(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- README.md
- docs/attributes/pick-negative-attribute.md
🚧 Files skipped from review as they are similar to previous changes (3)
- docs/attributes/inline-auto-mock-data-attribute.md
- docs/attributes/ignore-virtual-members-attribute.md
- docs/attributes/auto-mock-data-attribute.md
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/docs.yml
70-70: property "artifacts" is not defined in object type {deployment: {conclusion: string; outcome: string; outputs: {page_url: string}}}
(expression)
🪛 YAMLlint (1.37.1)
.github/workflows/docs.yml
[error] 66-66: trailing spaces
(trailing-spaces)
[error] 77-77: no new line character at the end of file
(new-line-at-end-of-file)
mkdocs.yml
[error] 24-24: no new line character at the end of file
(new-line-at-end-of-file)
[error] 24-24: trailing spaces
(trailing-spaces)
🪛 LanguageTool
docs/attributes/member-auto-mock-data-attribute.md
[uncategorized] ~11-~11: You might be missing the article “a” here.
Context: ...ocking library. The member must return type compatible with Enumerable<object[]> ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~13-~13: A comma may be missing after the conjunctive/linking adverb ‘Hence’.
Context: ... by .ToList() before any test is run. Hence it should return independent object set...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
docs/index.md
[uncategorized] ~3-~3: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ... AutoFixture.XUnit2.AutoMock is a free, open source tool that accelerates the preparation o...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
docs/supported-mocking-libraries.md
[style] ~7-~7: Using many exclamation marks might seem excessive (in this case: 6 exclamation marks for a text that’s 1427 characters long)
Context: .../github.com/FakeItEasy/FakeItEasy) | [
docs/tips-and-tricks.md
[uncategorized] ~34-~34: You might be missing the article “the” here.
Context: ...er Substitute { get; set; } } ``` Only Substitute property is explicitly marke...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~34-~34: Possible missing comma found.
Context: ...g properties as virtual and sealed. Consequently [AutoFixture](https://github.com/AutoFi...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build-test-pack (AutoNSubstitute) / run
- GitHub Check: build-test-pack (AutoFakeItEasy) / run
- GitHub Check: build-test-pack (Core) / run
- GitHub Check: build-test-pack (AutoMoq) / run
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.artifacts.outputs.page_url }} | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
environment.url points to a non-existent output – workflow will fail
actions/upload-pages-artifact (step artifacts) doesn’t expose a page_url output.
The page_url comes from actions/deploy-pages, which you already invoke in the step with id deployment. Reference that step instead:
- url: ${{ steps.artifacts.outputs.page_url }}
+ url: ${{ steps.deployment.outputs.page_url }}Without this change actionlint (and the runtime run) will error out with “property … is not defined”.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| environment: | |
| name: github-pages | |
| url: ${{ steps.artifacts.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest |
🧰 Tools
🪛 actionlint (1.7.7)
70-70: property "artifacts" is not defined in object type {deployment: {conclusion: string; outcome: string; outputs: {page_url: string}}}
(expression)
🤖 Prompt for AI Agents
In .github/workflows/docs.yml around lines 68 to 71, the environment.url is
incorrectly set to use an output named page_url from the step with id artifacts,
which does not exist. To fix this, change the reference to use the output
page_url from the step with id deployment, which is the correct source of this
output. This will prevent actionlint and runtime errors about undefined
properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
mkdocs.yml (2)
16-18: Quote theCustomizeWith<T>key to avoid YAML edge-case parsing issuesAlthough most YAML parsers accept angle brackets inside plain scalars, quoting the value makes the intent explicit and eliminates any risk of a mis-parse by stricter tooling or syntax highlighters.
- - CustomizeWith<T>: attributes/customize-with-t-attribute.md + - "CustomizeWith<T>": attributes/customize-with-t-attribute.md
23-23: Append a trailing newline
yamllintflags the missing newline at EOF (new-line-at-end-of-file).
Adding it keeps the file POSIX-compliant and silences the linter.- - Tips and Tricks: tips-and-tricks.md + - Tips and Tricks: tips-and-tricks.md +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
mkdocs.yml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
mkdocs.yml
[error] 23-23: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build-test-pack (AutoNSubstitute) / run
- GitHub Check: build-test-pack (AutoFakeItEasy) / run
- GitHub Check: build-test-pack (Core) / run
- GitHub Check: build-test-pack (AutoMoq) / run
Summary by CodeRabbit