Looking for MAUI Mock Package like Xamarin.Forms.Mocks #18306
Replies: 6 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.
-
I've come across this as I'm trying to write a simple unit test for my view model that uses the When using the net8.0 I get an error for the first view model that tells me I need to reference the assembly because it isn't included in the portable binary. I've spent probably three hours at this point researching this and have gotten nowhere. For reference, what I have tried so far:
Could someone point me in the right direction? This is my company's first try with MAUI, a lot is riding on this succeeding. |
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