Skip to content

NUnit2045 - false positive for inline usings #918

@BodrickLight

Description

@BodrickLight

NUnit2045 in nunit.analyzers v4.10.0 raises a false positive if you use the inline using declaration syntax to enter a multiple scope.

[Test]
public void Test()
{
    var t = true;
    var f = false;
    using var scope = Assert.EnterMultipleScope();
    Assert.That(t, Is.True); // NUnit2045: Call independent Assert statements from inside an Assert.EnterMultipleScope or Assert.Multiple
    Assert.That(f, Is.False);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions