Skip to content

Assert.Multiple method should fail only if a contained assertion failed #4264

Description

@rockstome

Here is code

namespace Tests
{
    public class NUnit
    {
        [TearDown]
        public void TearDown()
        {
            System.Console.WriteLine("Teardown 1");
            Assert.Multiple(() =>
            {
                Assert.That(true);
            });
            System.Console.WriteLine("Teardown 2");
        }

        [Test]
        public void Test()
        {
            System.Console.WriteLine("Test 1");
            Assert.That(false);
            System.Console.WriteLine("Test 2");
        }
    }
}

What is very strange for me, line where "Teardown 2" should be printed is not executed. Why is this happening? Assertion in teordown is not throwing any exception

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions