Resharper unit test inheritance

Has anyone got a strategy for testing a gearchy in Resharper?

I usually use the TestDriven.Net and Resharper tests, with NUnit tests. TestDriven is awesome for everything, but quickly finds a bad test from a batch run (which can be thousands), which includes the Resharper runner.

I usually use a template with an abstract base class (like the code below) for test cases overridden to get the right subclass that works fine in TestDriven, but Resharper just ignores them! I thought that with v5.0 Resharper used the NUnit code base, which means that this should work, but it is not.

Cheers,
Berryl

[TestFixture]
public class AdminAccountTests : AccountTests
{
    protected override Account _GetAccount() { return new AdminAccount(_idScheme, _description); }
}

[TestFixture]
public class LeaveTimeAccountTests : AccountTests
{
    protected override Account _GetAccount() { return new LeaveTimeAccount(_idScheme, _description); }
}

public abstract class AccountTests
{
    protected abstract Account _GetAccount();

    [SetUp]
    public void SetUp()
    {
        _account = _GetAccount();
    }

    [Test]
    public void OnCreation_Blah() {
        Assert.That(_account.IdScheme, Is.EqualTo(_idScheme));
    }

}
+3
2

a TestFixture. R #.

EDIT: , R # ( 5.1 NUnit 2.6) , Test , , TestFixture. .

0

MbUnit Gallio resharper 5.1.3000.12. visual studio, . , .

JetBrains ReSharper 5.1 # Edition 5.1.3000.12 2011-01-28T05: 05: 56

: 1. "Gallio Test Runner" v3.2.0.0 Gallio Visual Studio 9.0.30729.1.

Copyright Β© 2003-2011 JetBrains s.r.o.. .

+1

Source: https://habr.com/ru/post/1762918/


All Articles