Looking for MAUI Mock Package like Xamarin.Forms.Mocks #18306
Replies: 5 comments 16 replies
-
Honestly i don't see it happening this soon, for the mean time you could checkout https://github.com/dotnet/maui/blob/main/src/Controls/tests/Core.UnitTests/ContentViewUnitTest.cs |
Beta Was this translation helpful? Give feedback.
-
I really think this is a really big drawback of Maui. Not being able to mock a |
Beta Was this translation helpful? Give feedback.
-
ChatGPT is basically the same thing |
Beta Was this translation helpful? Give feedback.
-
I came across this discussion when I tried to unit test behaviors (namely, behaviors that attach to ListView). Unit testing requires some extra effor in .NET MAUI apps. To summarize some important points:
Furthermore, have a look at how the MAUI guys test their own stuff and how the CommunityToolkit.Maui guys test their stuff: They replace a lot of dependencies with mock objects before they run their test code. |
Beta Was this translation helpful? Give feedback.
-
Description
I'm currently working on a project using MAUI and need a mocking framework similar to
Xamarin.Forms.Mocks
for MAUI. However, I'm unsure if there's an equivalent library specifically designed for MAUI. Could anyone recommend an alternative or provide guidance on how to handle mocking in MAUI projects?Public API Changes
No API Changes
Intended Use-Case
For writing test cases on View and View Model level.
Beta Was this translation helpful? Give feedback.
All reactions