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

Enable item renaming and add tests for ApplicationDataStorageHelper #4173

Merged
merged 4 commits into from
Aug 19, 2021

Conversation

shweaver-MSFT
Copy link
Member

@shweaver-MSFT shweaver-MSFT commented Aug 10, 2021

Fixes

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature

What is the current behavior?

There is currently no methods for renaming items via the IFileStorageHelper interface.

Also, the ApplicationDataStorageHelper needs more tests to validate that the file storage functionality is working as expected.

What is the new behavior?

To support renaming items, I've added a new method IFileStorageHelper.TryRenameItemAsync.

In addition, I've also updated the IFileStorageHelper.DeleteItemAsync method to TryDeleteItemAsync to match the convention. It seems reasonable to expect that the file intended for deletion does not already exist, so the consumer should be able to handle this gracefully, without exceptions.

Lastly, while adding tests for ApplicationDataStorageHelper I discovered that it doesn't handle items in sub-folders very well. So I've made some fixes there as well to support CRUD operations with files/folders in sub-directories.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@ghost
Copy link

ghost commented Aug 10, 2021

Thanks shweaver-MSFT for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from michael-hawker, azchohfi and Rosuavio August 10, 2021 20:27
@shweaver-MSFT shweaver-MSFT marked this pull request as ready for review August 10, 2021 21:26
@shweaver-MSFT shweaver-MSFT added this to the 7.1 milestone Aug 18, 2021
@ghost
Copy link

ghost commented Aug 19, 2021

Hello @michael-hawker!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@michael-hawker michael-hawker merged commit b605154 into main Aug 19, 2021
@delete-merged-branch delete-merged-branch bot deleted the shweaver/file-storage branch August 19, 2021 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants