Skip to content

Conversation

@cbersch
Copy link
Member

@cbersch cbersch commented Sep 17, 2025

Fixes #51

@coveralls
Copy link

coveralls commented Sep 17, 2025

Coverage Status

coverage: 93.624% (+1.5%) from 92.079%
when pulling cf7e587 on fix-elementat-if-class-implements-ilist
into 051ae44 on main.

@cbersch cbersch force-pushed the fix-elementat-if-class-implements-ilist branch 3 times, most recently from 1043a8f to decc095 Compare September 18, 2025 06:03
@cbersch cbersch force-pushed the fix-elementat-if-class-implements-ilist branch from decc095 to cf7e587 Compare September 18, 2025 06:30
@sonarqubecloud
Copy link

@cbersch cbersch marked this pull request as ready for review September 18, 2025 07:09
@cbersch cbersch self-assigned this Sep 18, 2025
@cbersch cbersch requested a review from a team September 18, 2025 07:09
@ScarletKuro
Copy link
Contributor

I feel weird about this

public IEnumerable<object[]> XYZ()
{
    ...
    yield return new object[] { oldAssertion, newAssertion }
        .Concat(AdditionalParameters)
        .ToArray();
}

We're materializing an IEnumerable into an array and then returning it as an IEnumerable. Why not just return an Array \ IReadOnlyList etc directly instead?

@cbersch
Copy link
Member Author

cbersch commented Sep 18, 2025

We're materializing an IEnumerable into an array and then returning it as an IEnumerable. Why not just return an Array \ IReadOnlyList etc directly instead?

This is a bit weird, but note that we return an IEnumerable<object[]>, which is the required type for data-driven tests with MSTest.

The new object[] { oldAssertion, newAssertion }.Concat(AdditionalParameters) .ToArray() creates a single element of the IEnumerable, with content [oldAssertion, newAssertion, AdditionalParameters[0],...].

@ScarletKuro
Copy link
Contributor

Ah, so it's part of the ITestDataSource contract, I didn’t see that from my phone. Okay, makes sense. Since it's just test data, I shouldn't really be concerned about allocation / performance here.

@cbersch cbersch merged commit 484ccaa into main Sep 18, 2025
8 checks passed
@ScarletKuro ScarletKuro deleted the fix-elementat-if-class-implements-ilist branch September 18, 2025 11:55
@cbersch cbersch added the bug Something isn't working label Sep 18, 2025
gritcsenko added a commit to gritcsenko/HomeInventory that referenced this pull request Sep 20, 2025
Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs
from Renovate will soon appear from 'Mend'. Learn more
[here](https://github.com/renovatebot/renovate/discussions/37842).

This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
|
[AwesomeAssertions.Analyzers](https://github.com/awesomeassertions/awesomeassertions.analyzers)
| `9.0.3` -> `9.0.4` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/AwesomeAssertions.Analyzers/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/AwesomeAssertions.Analyzers/9.0.3/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>awesomeassertions/awesomeassertions.analyzers
(AwesomeAssertions.Analyzers)</summary>

###
[`v9.0.4`](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/releases/tag/v9.0.4)

<!-- Release notes generated using configuration in .github/release.yml
at main -->

#### What's Changed

##### Fixes

- Suggest ElementAt only if type implements IList or IReadOnlyList by
[@&#8203;cbersch](https://github.com/cbersch) in
[AwesomeAssertions/AwesomeAssertions.analyzers#63](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/pull/63)

##### Dependencies

- chore(deps): update dependency xunit.runner.visualstudio to 3.1.4 by
[@&#8203;renovate](https://github.com/renovate)\[bot] in
[AwesomeAssertions/AwesomeAssertions.analyzers#59](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/pull/59)
- chore(deps): update mstest monorepo to 3.10.3 - autoclosed by
[@&#8203;renovate](https://github.com/renovate)\[bot] in
[AwesomeAssertions/AwesomeAssertions.analyzers#60](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/pull/60)
- chore(deps): update dependency nunit3testadapter to 5.1.0 by
[@&#8203;renovate](https://github.com/renovate)\[bot] in
[AwesomeAssertions/AwesomeAssertions.analyzers#62](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/pull/62)
- chore(deps): update dependency nunit to 4.4.0 by
[@&#8203;renovate](https://github.com/renovate)\[bot] in
[AwesomeAssertions/AwesomeAssertions.analyzers#61](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/pull/61)

##### Others

- Enable coveralls by
[@&#8203;cbersch](https://github.com/cbersch) in
[AwesomeAssertions/AwesomeAssertions.analyzers#58](https://github.com/AwesomeAssertions/AwesomeAssertions.analyzers/pull/58)

**Full Changelog**:
<AwesomeAssertions/AwesomeAssertions.analyzers@v9.0.3...v9.0.4>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/gritcsenko/HomeInventory).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45Ny4xMCIsInVwZGF0ZWRJblZlciI6IjQxLjk3LjEwIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Should().HaveElementAt() is a false positive when a class implement an indexer but no collection related interface

4 participants