Blogpost about support of MTP across test frameworks #4701
Replies: 3 comments 8 replies
-
Just a couple of things:
Correct would be: public class CalculatorTests
{
[Test]
public async Task Add_WhenCalled_ReturnsSum()
{
var calculator = new Calculator();
var result = calculator.Add(1, 2);
await Assert.That(result).IsEqualTo(3);
}
}
|
Beta Was this translation helpful? Give feedback.
-
My list:
|
Beta Was this translation helpful? Give feedback.
-
NUnit:
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NUnit" Version="4.3.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.6.0"/>
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
</ItemGroup>
public class CalculatorTests
{
[Test]
public void Add_WhenCalled_ReturnsSum()
{
var calculator = new Calculator();
var result = calculator.Add(1, 2);
Assert.That(result,Is.EqualTo(3));
}
} |
Beta Was this translation helpful? Give feedback.
-
Dear framework authors @thomhurst @bradwilson @OsirisTerje @rprouse @Alxandr @haf,
I would like to write a blogpost about the support of MTP (Microsoft.Testing.Platform) in the various test frameworks. Here is the draft about it and I would really like to get your feedback about it.
Reflecting on a Year of Microsoft.Testing.Platform
A year ago, we launched
Microsoft.Testing.Platform
as part of the MSTest Runner announcement. Our goal was to create a reliable testing platform for .NET projects, focused on extensibility and modularity. Over the past year, we've collaborated with the community and test framework authors to enhance this platform, enriching the ecosystem and providing better tools and integrations for developers.In this post, we’ll highlight the test frameworks that have embraced
Microsoft.Testing.Platform
, share their unique characteristics, and provide resources for getting started.Get Started with Microsoft.Testing.Platform
Enabling Microsoft.Testing.Platform in your favorite test framework
The test frameworks are ordered alphabetically.
Expecto
Expecto aims to make it easy to test CLR based software; be it with unit tests, stress tests, regression tests or property based tests. Expecto tests are parallel and async by default, so that you can use all your cores for testing your software. This also opens up a new way of catching threading and memory issues for free using stress testing.
With the release of vTO BE DEFINED,
YoloDev.Expecto.TestSdk
now supports running test through the new testing platform. To opt-in, simply edit your projects to set<EnableExpectoRunner>true</EnableExpectoRunner>
and<OutputType>Exe</OutputType>
.Sample Application
Contoso.fsproj:
Test.fs:
MSTest
MSTest, Microsoft Testing Framework, is a fully supported, open source, and cross-platform test framework with which to write tests targeting .NET Framework, .NET Core, .NET, UWP, and WinUI on Windows, Linux, and Mac.
With the release of v3.2.0,
MSTest.TestAdapter
now supports running test through the new testing platform. To opt-in, simply edit your projects to set<EnableMSTestRunner>true</EnableMSTestRunner>
and<OutputType>Exe</OutputType>
.Sample Application
Contoso.Tests.csproj:
Test.cs:
NUnit
NUnit is a unit-testing framework for all .NET languages. Initially ported from JUnit, the current production release has been completely rewritten with many new features and support for a wide range of .NET platforms.
With the release of v5,
NUnit3TestAdapter
now supports running test through the new testing platform. To opt-in, simply edit your projects to set<EnableNUnitRunner>true</EnableNUnitRunner>
and<OutputType>Exe</OutputType>
.Sample Application
Contoso.Tests.csproj:
Test.cs:
TUnit
TUnit is a modern, flexible and fast testing framework for C#. With Native AOT and Trimmed Single File application support included!
Sample Application
Contoso.csproj:
Test1.cs:
xUnit.net
xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages.
Sample Application
With the release of
xunit.v3
, xUnit.net now supports running test through the new testing platform. To opt-in, simply edit your projects to set<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
.Sample Application
Contoso.Tests.csproj:
Test.cs:
Looking Ahead
We would like to extend our heartfelt appreciation to the framework authors we have collaborated with and continue to work closely with.
We are thrilled to witness the ongoing evolution of this platform and its ability to empower developers. We eagerly anticipate numerous contributions from the community and look forward to the innovative extensions that will be created.
If you haven't already, we encourage you to explore the platform, experiment with your preferred framework, and share your feedback.
Together, let's continue to build an outstanding .NET testing ecosystem!
Beta Was this translation helpful? Give feedback.
All reactions