You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
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
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
Remove ConnectionHelper tests for now, see Issue #3196
Remove ConnectionHelper tests for now, see Issue #3196
mrlacey commentedon Nov 10, 2020
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.
michael-hawker commentedon Nov 11, 2020
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.