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: File support components testing, cleanup and refactors. #44

Conversation

matthewtoghill
Copy link
Collaborator

Description

  • Refactor FileService to remove remaining dependency on System.Drawing
  • Fix BlobStorageService GetFileType() to use string.ToLower()
    • Add unit tests for GetFileType()
  • Add unit tests to FileServiceTests
  • Remove duplicate Trait declarations in test classes
  • General tidy up
  • Update packages

Motivation and Context

#31 replaced System.Drawing implementation, however FileService still had a dependency on System.Drawing for its Size class. As we are not using any specific functionality from the Size class and are just using it to represent data then we can replace it with a tuple.

Other changes in this PR are to:

  • fix a bug with the GetFileType method that was not handling strings with uppercase characters properly.
  • correct some typos and apply consistent style in some areas
  • add unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CesarD CesarD self-requested a review March 8, 2023 17:47
Copy link
Collaborator

@CesarD CesarD left a comment

Choose a reason for hiding this comment

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

When #31 was implemented I didn't remove the use of the Size struct because it is part of the framework itself, so no additional dependency was required and was mainly used as a helper class... Just a little context on why it was still there 😉

@CesarD CesarD linked an issue Mar 9, 2023 that may be closed by this pull request
@CesarD CesarD changed the title FEAT: Remove remaining System.Drawing dependency FEAT: File support components testing, cleanup and refactors. Mar 9, 2023
@CesarD CesarD merged commit a8fa647 into onebeyond:main Mar 9, 2023
@matthewtoghill matthewtoghill deleted the refactor/remove-system-drawing-dependency branch March 9, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests for file support components
2 participants