dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 532 forks source link

Add support for `dotnet test` #9496

Open jpobst opened 2 weeks ago

jpobst commented 2 weeks ago

With https://github.com/dotnet/android/pull/9470, we are now able to support dotnet run in .NET for Android projects. The next logical step would be to support dotnet test.

Ideally, this would probably take the form of a new ".NET for Android Test Project" template. Using this template, a user could write a test such as:

[Test]
public void Round () {
  Assert.AreEqual (3, Java.Lang.Math.Round (3.4));
}

Running dotnet test would:

Note from Discord:

Alexander Köplinger: this should be much easier with the new/upcoming mstest runner infra where the test is not a special project anymore but just a regular "executable"

We could definitely use dotnet test support like this in this repository instead of the custom infrastructure we currently have to run tests on emulators/devices.