Skip to content

fix: ensure FlushAsync behaves like Flush - #960

Merged
mergify[bot] merged 3 commits into
TestableIO:mainfrom
cryocz:issue/959
Mar 13, 2023
Merged

fix: ensure FlushAsync behaves like Flush#960
mergify[bot] merged 3 commits into
TestableIO:mainfrom
cryocz:issue/959

Conversation

@cryocz

@cryoczcryocz commented Mar 10, 2023

Copy link
Copy Markdown
Contributor

Added an overwrite for Stream.FlushAsync to the MockFileStream class, which ensures that the internal flush implementation is called. This way FlushAsync will correctly project the changes to the underlying MockFile, exactly like Flush does.

Closes#959

Added a replication test for bug #959, which relates to incorrect handling of
`MockFileStream.FlushAsync`.
Fixed a bug (#959) related to the `MockFileStream.FlushAsync` method. Added an
overwrite that synchronously invokes the internal flush implementation. This
resolves the issue where `FlushAsync` wouldn't project the changes to the
`Contents` of the underlying file (like `Flush` does).
@fgreinacher
fgreinacher self-requested a review March 11, 2023 15:11
Unit tests were using a `Span<T>` based overload for `Stream.WriteAsync`, which
did not exist in old versions of .NET (namely .NET 4). Expanded the call to use
an offset and length as required by the old API.

@fgreinacherfgreinacher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking great, thanks!

@fgreinacherfgreinacher changed the title fix: #959 - Ensure FlushAsync behaves like Flushfix: ensure FlushAsync behaves like FlushMar 13, 2023
@mergify
mergifyBot merged commit 2b6dba4 into TestableIO:mainMar 13, 2023
vbreuss referenced this pull request in Testably/Testably.Abstractions Apr 9, 2023
…19.2.4 (#281)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
|
[TestableIO.System.IO.Abstractions](https://togithub.com/TestableIO/System.IO.Abstractions)
| nuget | patch | `19.2.1` -> `19.2.4` |
---
### Release Notes
<details>
<summary>TestableIO/System.IO.Abstractions</summary>
###
[`v19.2.4`](https://togithub.com/TestableIO/System.IO.Abstractions/releases/tag/v19.2.4)
##### What's Changed
- fix: make FileSystemStream path argument non-nullable by
[@&#8203;oreze](https://togithub.com/oreze) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/956](https://togithub.com/TestableIO/System.IO.Abstractions/pull/956)
- chore(deps): update danielpalme/reportgenerator-github-action action
to v5.1.19 by [@&#8203;renovate](https://togithub.com/renovate) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/958](https://togithub.com/TestableIO/System.IO.Abstractions/pull/958)
- fix: ensure `FlushAsync` behaves like `Flush` by
[@&#8203;cryocz](https://togithub.com/cryocz) in
[https://github.com/TestableIO/System.IO.Abstractions/pull/960](https://togithub.com/TestableIO/System.IO.Abstractions/pull/960)
##### New Contributors
- [@&#8203;oreze](https://togithub.com/oreze) made their first
contribution in
[https://github.com/TestableIO/System.IO.Abstractions/pull/956](https://togithub.com/TestableIO/System.IO.Abstractions/pull/956)
- [@&#8203;cryocz](https://togithub.com/cryocz) made their first
contribution in
[https://github.com/TestableIO/System.IO.Abstractions/pull/960](https://togithub.com/TestableIO/System.IO.Abstractions/pull/960)
**Full Changelog**:
TestableIO/System.IO.Abstractions@v19.2.1...v19.2.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 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://app.renovatebot.com/dashboard#github/Testably/Testably.Abstractions).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNjAuMCIsInVwZGF0ZWRJblZlciI6IjM0LjE2MC4wIn0=-->
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Valentin Breuß <vbreuss@gmail.com>
Co-authored-by: Valentin Breuß <v.breuss@tig.at>
@github-actions

Copy link
Copy Markdown

This is addressed in release v19.2.4.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: releasedIssues that are released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlushAsync doesn't update file contents

2 participants

@cryocz@fgreinacher