Skip to content

Releases: microsoft/testfx

v4.0.0

07 Oct 19:03
Compare
Choose a tag to compare

What is new?

Assert.That

MSTest v4 adds a new type of assertion, that allows you to write any expression, and it will inspect the result to give you more information on failure. Providing a very flexible way to assert complicated expressions. Here a simple example:

[TestClass]
public sealed class Test1
{
    [TestMethod]
    public void TestMethod1()
    {
        var animal = "Tiger";
        var zoo = new Zoo();
        Assert.That(() => zoo.GetAnimal() == animal);
    }
}

public class Zoo
{
    public string GetAnimal()
    {
        return "Giraffe";
    }
}
Assert.That(() => zoo.GetAnimal() == animal) failed.
Details:
    animal = "Tiger"     
    zoo.GetAnimal() = "Giraffe"

CallerArgumentExpression

CallerArgumentExpression is consumed by all assertions, to make them aware of the expressions used in the assertion. In the example below, we now know what both the expected and actual values are. But also what value they come from, giving us opportunity to provide better error messages:

[TestClass]
public sealed class Test1
{
    [TestMethod]
    public void TestMethod1()
    {
        string animal = null;
        Assert.AreEqual("Giraffe", animal);
    }
}
Error Message: Assert.AreEqual failed. Expected:<Giraffe>. Actual:<>. 
'expected' expression: '"Giraffe"', 'actual' expression: 'animal'.

Breaking changes

We hidden many types that should have never been public in the first place. We believe that most of the changes won't have any real user impact. For the changes where we expect user impact migration guide from v3 is provided: https://learn.microsoft.com/dotnet/core/testing/unit-testing-mstest-migration-v3-v4

See the MSTest changelog here: https://github.com/microsoft/testfx/blob/main/docs/Changelog.md#4.0.0
See the Microsoft.Testing.Platform changelog here: https://github.com/microsoft/testfx/blob/main/docs/Changelog-Platform.md#2.0.0

Full changelog here: v3.11.0...v4.0.0

v3.11.0

01 Oct 13:38
e64ddb3
Compare
Choose a tag to compare

See the release notes here

v3.10.5

30 Sep 14:32
8c73bdb
Compare
Choose a tag to compare

See the release notes here

v3.10.4

02 Sep 12:43
ac62226
Compare
Choose a tag to compare

See the release notes here

v3.10.3

26 Aug 07:09
d554f31
Compare
Choose a tag to compare

See the release notes here

v3.10.2

12 Aug 09:01
3f38950
Compare
Choose a tag to compare

See the release notes here

v3.10.1

05 Aug 17:34
baac22c
Compare
Choose a tag to compare

See the release notes here

v3.10.0

29 Jul 15:32
cbe2c37
Compare
Choose a tag to compare

See the release notes here

v4.0.0-preview.25372.6

22 Jul 17:56
c53362a
Compare
Choose a tag to compare
Pre-release

This is a prerelease of MSTest v4. Docs on migration from v3 to v4 are in progress. We are working towards addressing the items tracked in #1285 and #5762

v4.0.0-preview.25358.7

08 Jul 14:58
60d4a66
Compare
Choose a tag to compare
Pre-release

This is a prerelease of MSTest v4. Docs on migration from v3 to v4 are in progress. We are working towards addressing the items tracked in #1285 and #5762