Maui -- unit testing -- class libraries

1 Answer 266 Views
DataGrid General Discussions
Larry
Top achievements
Rank 1
Iron
Iron
Veteran
Larry asked on 27 May 2022, 11:54 PM

So...

Maui apps can't have unit tests in a test project? Is that right? So, I have to move code I want to test into class libraries?

But Maui class libraries cannot contain Telerik code. Is that right? I can get Resharper to offer this:

but none of those options do anything. I have the Telerik Maui nuget installed in the class library.

FWIW, I am porting over a Xamarin Forms project and trying to figure out how to structure the app and what my limitations are...

 

 

1 Answer, 1 is accepted

Sort by
0
Antoan
Telerik team
answered on 02 Jun 2022, 11:11 AM

Hello Larry,

Thank you for your interest in Telerik UI for .NET MAUI.

Currently Unit Testing in .NET MAUI is in its early stages. To get more information about testing in .NET MAUI you can go to the following link leading to Microsoft's Unit Test Toolkit: https://github.com/CommunityToolkit/Maui/tree/main/src/CommunityToolkit.Maui.UnitTests

You can also check the sample app Microsoft has created to demonstrate .NET 6.0 Test Support in .NET MAUI: https://github.com/dotnet/maui/pull/3017/files#diff-122eebe5d0327fc0f1b0e3adbe4f389ae05511f39e5debc49effecdab71481c7 

Regarding the required Telerik .NET MAUI dlls, I can suggest you add them to the test project manually (as assembly reference) instead of package reference.

I hope the provided information helps.

Regards,
Antoan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DataGrid General Discussions
Asked by
Larry
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Antoan
Telerik team
Share this question
or