1

Closed

inherited tests bug

description

Unit Driven doesn't handle inherited tests correctly. The UI displays the Tests it inherit (correct) but when you run the tests it gets ran on an instance of the class THAT THE TEST WAS DECLARED ON. The following test should pass. It's even worse when inheriting from an abstract class. Problem is in InitializeInstance of TestCommand
public class ExampleTests
{
    public virtual int A { get { return 1; } }
 
    [TestMethod]
    public void EmptyTest()
    {
        Assert.AreEqual(5, A);
    }
}
 
[TestClass]
public class ExampleTests2 : ExampleTests
{
    public override int A
    {
        get
        {
            return 5;
        }
    }
}
Closed Dec 13, 2010 at 5:48 PM by justinc
fixed.

comments