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

feat: add testability for DriveInfo #1094

Merged
merged 3 commits into from
Mar 9, 2024

Conversation

FantasyTeddy
Copy link
Contributor

@FantasyTeddy FantasyTeddy commented Mar 8, 2024

Fixes #826

This adds the possibility to add drives to the MockFileSystem together with a MockDriveData that can be used to configure the various properties of the drive (free space, type, etc.).

Copy link
Member

@vbreuss vbreuss left a comment

Choose a reason for hiding this comment

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

Thanks a lot @FantasyTeddy.
The overall implementation looks quite neat; I have only a few minor comments.

@vbreuss
Copy link
Member

vbreuss commented Mar 8, 2024

to configure how the drive should behave (free space, type, etc.).

Just to clarify: You did not implement any behaviour of the mocked drive, right?

I mean, you can now mock the DriveInfo by providing explicit values, but they don't affect the other functionality in the MockFileSystem (e.g. adjusting the AvailableFreeSpace when adding or deleting files, or manipulating file streams).

@FantasyTeddy
Copy link
Contributor Author

to configure how the drive should behave (free space, type, etc.).

Just to clarify: You did not implement any behaviour of the mocked drive, right?

I mean, you can now mock the DriveInfo by providing explicit values, but they don't affect the other functionality in the MockFileSystem (e.g. adjusting the AvailableFreeSpace when adding or deleting files, or manipulating file streams).

You are correct of course. I changed my wording to hopefully prevent confusion.

@vbreuss vbreuss enabled auto-merge (squash) March 9, 2024 15:49
@vbreuss vbreuss merged commit 3229ce9 into TestableIO:main Mar 9, 2024
8 checks passed
@FantasyTeddy FantasyTeddy deleted the mockable-drives branch March 9, 2024 15:58
Copy link

github-actions bot commented Mar 9, 2024

This is addressed in release v20.0.28.

@github-actions github-actions bot added the state: released Issues that are released label Mar 9, 2024
mergify bot referenced this pull request in Testably/Testably.Abstractions Mar 9, 2024
…20.0.28 (#475)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[TestableIO.System.IO.Abstractions](https://togithub.com/TestableIO/System.IO.Abstractions)
| `20.0.15` -> `20.0.28` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/TestableIO.System.IO.Abstractions/20.0.28?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/TestableIO.System.IO.Abstractions/20.0.28?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/TestableIO.System.IO.Abstractions/20.0.15/20.0.28?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/TestableIO.System.IO.Abstractions/20.0.15/20.0.28?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>TestableIO/System.IO.Abstractions
(TestableIO.System.IO.Abstractions)</summary>

###
[`v20.0.28`](https://togithub.com/TestableIO/System.IO.Abstractions/releases/tag/v20.0.28)

##### What's Changed

- chore(deps): update dotnet/nbgv action to v0.4.2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1082](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1082)
- chore(deps): update dependency nunit.analyzers to v4 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1083](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1083)
- chore(deps): update dependency nunit.analyzers to v4.0.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1084](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1084)
- chore(deps): update danielpalme/reportgenerator-github-action action
to v5.2.1 by [@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1085](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1085)
- chore(deps): update dependency microsoft.net.test.sdk to v17.9.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1086](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1086)
- chore(deps): update dependency saucecontrol.inheritdoc to v2.0.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1087](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1087)
- chore(deps): update dependency dotnet-sdk to v8.0.200 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1088](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1088)
- chore(deps): update dependency dotnet-sdk to v8.0.201 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1089](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1089)
- chore(deps): update dependency coverlet.collector to v6.0.1 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1090](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1090)
- chore(deps): update danielpalme/reportgenerator-github-action action
to v5.2.2 by [@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1092](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1092)
- chore(deps): update dependency nunit to v4.1.0 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1093](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1093)
- chore(deps): update softprops/action-gh-release action to v2 by
[@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1095](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1095)
- feat: add testability for `DriveInfo` by
[@&#8203;FantasyTeddy](https://togithub.com/FantasyTeddy) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1094](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1094)

##### New Contributors

- [@&#8203;FantasyTeddy](https://togithub.com/FantasyTeddy) made their
first contribution in
[https://github.com/TestableIO/System.IO.Abstractions/pull/1094](https://togithub.com/TestableIO/System.IO.Abstractions/pull/1094)

**Full Changelog**:
TestableIO/System.IO.Abstractions@v20.0.15...v20.0.28

</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 becomes conflicted, 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 has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/Testably/Testably.Abstractions).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMzAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIzMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: released Issues that are released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to write a test that checks for insufficient space available?
2 participants