Skip to content

Make GVFSService.Windows & GVFSService.Mac follow similar implementation pattern #1045

Open

Description

@alameenshah

Reference -

In GVFSService.Windows.cs this.repoRegistry and this.requestHandler are created in Run rather than the constructor. Can we do the same here and create these in RunWithArgs?

Unless there is a reason this has to be in the constructor I think we'd be better off keeping the classes consistent across platforms.

Ameen (@alameenshah)
alameenshah 4 hours ago Author Member
Initializing these in the Constructor makes it easy for UT. Dependencies (repoRegistry, requestHandler) can be Mocked and the Mock objects can be injected as arguments to the Constructor. This is the pattern I use in the upcoming UT PR. We can probably use this pattern in GVFSService.Windows.cs if we decide to do UT for that class.

William Baker (@wilbaker)
wilbaker 7 minutes ago Member
We can probably use this pattern in GVFSService.Windows.cs if we decide to do UT for that class.
Even if we're not writing UT for Windows in the near future, can we still make the code structure on Mac and Windows consistent?

William Baker (@wilbaker)
wilbaker 6 minutes ago Member
If you add a TODO to your PR/Work Item for your UT work I am okay with deferring the change until then, I just don't want us to lose track of it 😄

Activity

  1. added this to the Backlog milestone on Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: macOSpr: refactoring

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions