-
I have a MAUI app which uses a custom toolkit to read from an xml file as part of the MAUI app. The xml file's build target is set to MauiAsset and exists in the root of the MAUI project. I would like to unit test the method responsible for reading the xml file, however when I run the unit test I get the error:
My unit tests exist in a class library as an xUnit Test Project which has the toolkit as a dependency. Even when I manually add a copy of the xml file into my unit test project and change its build target to MauiAsset in the .csproj file I still get the same error. My question is, what is the correct way to unit test methods in MAUI apps that read/write to files as a MauiAsset? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
At the moment, we have no explicit support for MAUI (and no plans for any). I also have no experience with MAUI, so I'm not clear what would be necessary to add support. Maybe someone else can help you determine what's going on here. |
Beta Was this translation helpful? Give feedback.
Thanks for your answer. It turns out the fix is to ensure you have added the:
In your xUnit test project .csproj file so that you can effectively target MauiAssets when reading and writing to files affected by that target.