Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

[Tests] Investigate how we can use Moq (or similar) in Unit Tests to fake WinRT APIs #3196

Closed

Description

@michael-hawker

Describe the problem this feature would solve

Discovered that we currently don't have any mocking setup in our Unit Tests in order to test things like the ConnectionHelper. Related to #2133 and #3165, though this is additional work not blocking the other issues/PRs.

Describe the solution

Need to find a mocking system that can mock WinRT APIs embedded within our helpers (not sure if this is possible, that's part of this investigation).

Activity

  1. added this to the 6.1 milestone on Mar 26, 2020
  2. added
    help wantedIssues identified as good community contribution opportunities
    on Apr 2, 2020
  3. modified the milestones: 6.1, 7.0 on May 6, 2020
  4. mrlacey commented on Nov 10, 2020

    @mrlacey
    Contributor

    After a few hours searching I'm not sure there's a supported mocking framework that will enable this.

    TypeMock.Isolator may be a possibility but I'm not sure of the practicalities of adding a dependency on something with a paid license.

    I'd instead look at creating a stub or adapter around the native calls that can then be adjusted as necessary for testing.

  5. michael-hawker commented on Nov 11, 2020

    @michael-hawker
    MemberAuthor

    Thanks for taking a look @mrlacey. 🦙❤ Some libraries have open source licenses, it was hard to tell if they do or not.

    I think with our new Unit Tests and soon to be Integration tests running in the CI that should cover the majority of the toolkit.

    I'll see if any of our inbox app teams are doing anything in this space as well and have any suggestions.

  6. modified the milestones: 7.0, future on Jan 5, 2021
  7. ghost removed this from the future milestone on Jan 5, 2021
  8. locked and limited conversation to collaborators on Jul 29, 2022
  9. converted this issue into a discussion #4664 on Jul 29, 2022
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions