Xamarin portable.NETStandard 1.5 unit test

I created a portable class library Selecting a project for portable and then target this in .NETStandard 1.5 from project properties enter image description here . Then I created a second project with exactly the same project settings, but added code to use to call and test the code in the first project. But I was not able to add MSTest to run the execution. I tried using the stack overflow guide # 41350323 but ran into problems. I wonder if any of them were able to use MSTest for unit testing portable libraries of .NETStandard classes. Note that I also tried using the guide for .NET core , but the MSTest Framework nuget does not seem to support .NETStandard.

If there is no unit test, is there a way to call from the console? I just need to check my code and it should not be so difficult.

+2
source share
1 answer

You can define the logic in the .NET Standard project (do not use PCL, but use the .NET Standard Class library template in VS2017 RC), but then the unit test project must have its target platform (UWP / Desktop / Xamarin or others) instead of .NET Standard . For example, in VS2017 RC, a typical unit testing project might be a .NET Core console application.

+2
source

Source: https://habr.com/ru/post/1014236/


All Articles