- Sep 10, 2022
-
-
Ruairidh MacLeod authored
* Add GetFileSystemEntries with SearchOption * Bump version * Add test for GetFileSystemEntries with SearchOption * call GetFileSystemEntries from EnumerateFileSystemEntries to reduce duplication Co-authored-by:
Florian Greinacher <florian@greinacher.de>
-
- Sep 04, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Aug 30, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Aug 26, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Aug 19, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Aug 15, 2022
-
-
davidrogers090 authored
* Adds CreateSymbolicLink support Adds a FileSystemInfo extension for wrapping convenience. Adds FEATURE_CREATE_SYMBOLIC_LINK to the build properties. Includes mock implementations and mock tests. Updates the ApiParityTests to no longer ignore CreateSymbolicLink for .net 6.0. Bumps the version in version.json. * Skip path tests on non-Windows platform Co-authored-by:
Florian Greinacher <florian@greinacher.de>
-
Valentin Breuß authored
Fix function call order also in second `Move` method Co-authored-by:
Valentin Breuß <v.breuss@tig.at>
-
- Aug 10, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Aug 03, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Aug 02, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Jul 19, 2022
-
-
Robert Dailey authored
When invoking the `Create()` and `Delete()` methods on `MockDirectoryInfo`, the `Exists` property should intrinsically invoke `Refresh()` the next time it is called. This is necessary to prevent returning stale state about the directory after those operations. Additional test cases have been added for `MoveTo()` as well, to ensure it also not returning stale state. For context, this change was motivated by PR #828 where similar issues were solved in `MockFileInfo`. Co-authored-by:
Florian Greinacher <florian@greinacher.de>
-
- Jul 15, 2022
-
-
Victor Llanir authored
* #849 - Implementing directory validation for ReadOnly files when trying to delete directory recursively * Removing unnecessary lock in methods
-
- Jul 12, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Jul 04, 2022
-
- Jun 27, 2022
-
-
renovate[bot] authored
Co-authored-by:
renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
-
- Jun 10, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- Jun 09, 2022
-
-
James Moore authored
-
- May 29, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- May 22, 2022
-
-
Florian Greinacher authored
-
- May 20, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- May 18, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- May 17, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- May 16, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- May 15, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- May 11, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
Florian Greinacher authored
-
- Apr 26, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com> Co-authored-by:
Florian Greinacher <florian@greinacher.de>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- Apr 25, 2022
-
-
Peter Baumann authored
Fixes #829 Fixes #830 BREAKING CHANGE: `MockFileData.NullObject` is now `internal`. Users need to create new `MockFileData` instances for representing arbitrary data. Detailed changes: * make MockFileData.NullObject internal The `MockFileData.NullObject` was introduced in commit 0d85da38 as a way to represent the data of a non-existing file. Nevertheless, the issue #830 shows that at least one person used it as "some arbitrary MockFileData of an existing file I don't care about". Reason: As we are going to really make this the data representing a non-existing file by fixing/changing the `Attribute` property in one of the next commits, make this property internal and thereby breaking to force all consumers to really think about their tests and if they really ment a non-existing file or simply some arbirary data. Otherwise, the upcoming change would have nasty side effects if the NullObject is used for arbitrary data of an existing file. An alternative considered would be to rename this static property (which is also breaking) to any users, but decided against it as I couldn't think of a usecase where explicitly creating a file or directory which doesn't exist instead of relying on what the library will for you when being asked for a non-existing file. E.g. it is the difference of var fs = new MockFileSystem(); var nonExistingPath = XFS.Path(@"c:\some\non\existing\file.txt"); fs.AddFile(nonExistingPath, MockFileData.NullObject); var fi = fs.FileInfo.FromFilename(nonExistingPath); vs simply relying on the library to return the correct data for the non-existing file: var fs = new MockFileSystem(); var nonExistingPath = XFS.Path(@"c:\some\non\existing\file.txt"); var fi = fs.FileInfo.FromFilename(nonExistingPath); All tests are adapted to no longer use the MockFileData.NullObject. * fix: return -1 in MockFileInfo.Attributes and MockDirectoryInfo According to the Microsoft documentation[1] the `Attributes` property of FileSystemInfo (base of FileInfo and DirectoryInfo) returns (FileAttributes)(-1) for a file/directory which doesn't exist when the object instance is created. The on disk content is not looked at when calling the `Attributes` property, only a pre-cached value is returned. Only calling `Refresh` will read from disk. To be on the safe side, I checked the documented behaviour with the real implemenation with the below code snipped and it indeed shows the documented behaviour. var fs = new FileSystem(); var expected = (FileAttributes)(-1); var fi = fs.FileInfo.FromFileName(@"x:\not-existing\path"); Assert.That(fi.Attributes, Is.EqualTo(expected)); This lead to quite some needed code adaptions, especially in the area of the `GetMockFileDataForRead` methods, as those now no longer throw an exception. Furthermore, as cachedMockFileData is always a non-null instance, get rid of the logic checking for null in `GetMockFileDataForRead` and `MockFileInfo.CopyTo(string destFileName)` method. Also ensure that the used MockFileData is always `Clone`ed (and therefore even the MockFileData.NullObject) so that we operate on our own copy and don't get any updates done in the FileSystem. With this new semantics the `MockDiretory.Exists` method requires special treatment, as we now must check for a valid MockFileData by checking if Attributes != -1. [1]: https://docs.microsoft.com/en-us/dotnet/api/system.io.filesysteminfo.attributes?view=net-6.0#remarks * MockFileInfo: add test setting Attributes on non-existing file Ensure that when setting the Attributes property on a non existing file the appropriate FileNotFoundException is thrown, as documented in [1]. [1]: https://docs.microsoft.com/en-us/dotnet/api/system.io.filesysteminfo.attributes?view=net-6.0#remarks * MockDirectory: add tests for Time property getters on non existing file Add tests that when trying to retrieve the time properties of a non existing file returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC) as documented in [1] [1]: https://docs.microsoft.com/en-us/dotnet/api/system.io.filesysteminfo.lastaccesstime?view=net-6.0#remarks * MockFileInfo: add tests for Time property getters on non existing file Add tests that when trying to retrieve the time properties of a non existing file returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC) as documented in [1] [1]: https://docs.microsoft.com/en-us/dotnet/api/system.io.filesysteminfo.lastaccesstime?view=net-6.0#remarks * Fix MockDirectoryInfo: throw correct exception on non-existing directory When setting one of the Time properties or the `Attributes` property on a non-existing directory, a DirectoryNotFoundException should be thrown. Fix the code by throwing the correct exception (it did throw a FileNotFoundExecption before) and add the missing tests. * Increase major version to 17.0 MockFileData.NullObject was made internal, which is a breaking change, therefore increase the major version.
-
- Apr 24, 2022
-
-
Naveen authored
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ ) Signed-off-by:
naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
-
- Mar 23, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- Mar 22, 2022
-
-
Peter Baumann authored
-
- Mar 14, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
- Mar 11, 2022
-
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-
renovate[bot] authored
Co-authored-by:
Renovate Bot <bot@renovateapp.com>
-