Xamarin portable .NETStandard 1.5 unit test
Asked Answered
R

1

2

I created a portable class library Project selection for portable and then targeted it at .NETStandard 1.5 from the project propertiesenter image description here. I then created a second project with the exact same project settings, but added code to use for invoking and testing the code in the first project. But I have been unable to add MSTest to use for triggering execution. I tried using the guidance at stack overflow # 41350323 but ran into problems. Wondering if anyone out there has been able to use MSTest for unit testing portable .NETStandard class libraries. Note that I also tried using the guidance for .NET core but the MSTest framework nuget does not seem to support .NETStandard.

If not a unit test, then is there a way to invoke from a console? I just need to test my code and this should not be so difficult.

Rootless answered 5/1, 2017 at 13:16 Comment(0)
P
2

You can define logic in a .NET Standard project (don't use PCL though, use the .NET Standard Class Library template in VS2017 RC), but then the unit test project should have its target platform (UWP/Desktop/Xamarin or others) instead of .NET Standard. For example, in VS2017 RC, a typical unit testing project can be a .NET Core console app.

Pooch answered 5/1, 2017 at 15:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.